/* ===========================================
   How It Works — Modal Guide Styles
   Scoped with .hiw- prefix to avoid conflicts
   =========================================== */

/* --- Modal sizing --- */
.hiw-modal-content {
    max-width: 1100px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px;
}

.hiw-body {
    padding: 0;
}

/* --- Layout: sidebar TOC + main content --- */
.hiw-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    min-height: 0;
}

@media (max-width: 900px) {
    .hiw-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Table of Contents sidebar --- */
.hiw-toc {
    position: sticky;
    top: 0;
    align-self: start;
    padding: 24px 0 24px 24px;
    border-right: 1px solid var(--border-color, #ddd);
    max-height: 85vh;
    overflow-y: auto;
}

.hiw-toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 12px;
}

.hiw-toc-link {
    display: block;
    font-size: 13px;
    color: #666;
    padding: 5px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    text-decoration: none;
    transition: all 0.2s;
}

.hiw-toc-link:hover,
.hiw-toc-link.active {
    border-left-color: var(--primary-color, #F7941D);
    color: var(--primary-color, #F7941D);
    background: rgba(247, 148, 29, 0.06);
}

.hiw-toc-link.hiw-toc-sub {
    padding-left: 24px;
    font-size: 12px;
    color: #888;
}

@media (max-width: 900px) {
    .hiw-toc {
        display: none;
    }
}

/* --- Main content area --- */
.hiw-main {
    padding: 32px;
    min-width: 0;
}

@media (max-width: 600px) {
    .hiw-main {
        padding: 20px 16px;
    }
}

/* --- Section titles --- */
.hiw-section {
    margin-bottom: 48px;
}

.hiw-section:last-child {
    margin-bottom: 16px;
}

.hiw-h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.hiw-h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hiw-h4 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.hiw-subtitle {
    color: #777;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 640px;
}

.hiw-text {
    color: #777;
    font-weight: 300;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 16px;
}

/* --- Section dark header (Cutting/Bending) --- */
.hiw-section-header {
    background: #111120;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 28px;
}

.hiw-section-header .hiw-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fb923c;
    margin-bottom: 12px;
}

.hiw-section-header .hiw-h2 {
    color: white;
}

.hiw-section-header .hiw-subtitle {
    color: #9a9aae;
}

/* --- Process steps with timeline --- */
.hiw-process {
    position: relative;
}

.hiw-process-timeline {
    position: absolute;
    left: 28px;
    top: 56px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color, #F7941D), #c2410c);
}

@media (max-width: 600px) {
    .hiw-process-timeline {
        display: none;
    }
}

.hiw-step {
    position: relative;
    padding-left: 72px;
    margin-bottom: 28px;
}

@media (max-width: 600px) {
    .hiw-step {
        padding-left: 0;
    }
}

.hiw-step-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--primary-color, #F7941D), #ea580c);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.25);
    z-index: 2;
}

@media (max-width: 600px) {
    .hiw-step-num {
        position: static;
        margin-bottom: 12px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

.hiw-step-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e4e4ea;
    padding: 24px;
}

.hiw-step-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.hiw-step-card p {
    color: #777;
    font-weight: 300;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 12px;
}

.hiw-step-img {
    border-radius: 14px;
    border: 1px solid #e4e4ea;
    overflow: hidden;
}

.hiw-step-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Card grid --- */
.hiw-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.hiw-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 700px) {
    .hiw-grid-2,
    .hiw-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --- Info boxes --- */
.hiw-tip-box {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.hiw-tip-box .hiw-box-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.hiw-tip-box .hiw-box-title {
    font-weight: 600;
    color: #9a3412;
    margin-bottom: 4px;
    font-size: 14px;
}

.hiw-tip-box .hiw-box-text {
    color: #c2410c;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 0;
}

.hiw-warning-box {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.hiw-warning-box .hiw-box-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.hiw-warning-box .hiw-box-title {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 4px;
    font-size: 14px;
}

.hiw-warning-box .hiw-box-text {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 0;
}

.hiw-ok-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.hiw-ok-box .hiw-box-title {
    font-weight: 600;
    color: #166534;
    margin-bottom: 6px;
    font-size: 14px;
}

.hiw-ok-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hiw-ok-box li {
    color: #15803d;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.8;
}

.hiw-warning-list {
    padding: 16px 20px;
}

.hiw-warning-list .hiw-box-title {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 6px;
    font-size: 14px;
}

.hiw-warning-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hiw-warning-list li {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.8;
}

/* --- White cards --- */
.hiw-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e4e4ea;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.hiw-card:hover {
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15), 0 6px 24px rgba(0, 0, 0, 0.08);
}

.hiw-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #fff7ed;
}

.hiw-card-icon span {
    font-weight: 800;
    font-size: 12px;
    color: #ea580c;
}

/* --- Guide cards (left border) --- */
.hiw-guide-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e4e4ea;
    border-left: 3px solid var(--primary-color, #F7941D);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.hiw-guide-card:hover {
    border-left-color: #ea580c;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.hiw-guide-card h4 {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.hiw-guide-card p {
    color: #777;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
    margin: 0;
}

/* --- Spec tables --- */
.hiw-spec-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.hiw-spec-table th {
    background: #111120;
    color: white;
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
}

.hiw-spec-table th:first-child {
    border-radius: 8px 0 0 0;
}

.hiw-spec-table th:last-child {
    border-radius: 0 8px 0 0;
}

.hiw-spec-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #e4e4ea;
    color: #555;
}

.hiw-spec-table td:not(:first-child) {
    font-weight: 500;
    color: #333;
}

.hiw-spec-table tr:hover td {
    background: #fff7ed;
}

.hiw-table-wrap {
    overflow-x: auto;
}

.hiw-table-note {
    color: #999;
    font-size: 11px;
    font-weight: 300;
    margin-top: 8px;
}

/* --- Images --- */
.hiw-img-wrap {
    border-radius: 14px;
    border: 1px solid #e4e4ea;
    overflow: hidden;
    margin-bottom: 16px;
}

.hiw-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- File format badges --- */
.hiw-format-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8f8fa;
    border-radius: 10px;
    margin-bottom: 8px;
}

.hiw-format-badge {
    font-weight: 700;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
}

.hiw-format-badge.primary {
    background: var(--primary-color, #F7941D);
}

.hiw-format-badge.dark {
    background: #3a3a50;
}

.hiw-format-label {
    color: #555;
    font-size: 13px;
}

.hiw-format-rec {
    margin-left: auto;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
}

/* --- Material cards --- */
.hiw-material-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 800px) {
    .hiw-material-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .hiw-material-grid {
        grid-template-columns: 1fr;
    }
}

.hiw-material-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e4e4ea;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.hiw-material-card:hover {
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.12), 0 6px 24px rgba(0, 0, 0, 0.08);
}

.hiw-material-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.hiw-material-card h3 {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 15px;
    margin-bottom: 2px;
}

.hiw-material-card .hiw-material-grade {
    color: #999;
    font-size: 11px;
    font-weight: 300;
    margin-bottom: 8px;
}

.hiw-material-card .hiw-material-desc {
    color: #777;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 8px;
}

.hiw-material-card .hiw-material-thick {
    color: #999;
    font-size: 12px;
    font-weight: 300;
}

/* --- FAQ accordion --- */
.hiw-faq details {
    background: white;
    border-radius: 12px;
    border: 1px solid #e4e4ea;
    margin-bottom: 8px;
    overflow: hidden;
}

.hiw-faq summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
    list-style: none;
}

.hiw-faq summary::-webkit-details-marker {
    display: none;
}

.hiw-faq summary:hover {
    color: var(--primary-color, #F7941D);
}

.hiw-faq summary .hiw-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 12px;
    color: #999;
    transition: transform 0.2s;
}

.hiw-faq details[open] summary .hiw-chevron {
    transform: rotate(180deg);
}

.hiw-faq .hiw-faq-answer {
    padding: 0 20px 16px;
    color: #777;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.7;
}

/* --- Subsection divider --- */
.hiw-subsection {
    margin-bottom: 32px;
}

/* --- Scroll anchor offset (for TOC links) --- */
.hiw-main [id] {
    scroll-margin-top: 20px;
}
