/* ========================================
   Custom Suit Measurement Order - Styles
   ======================================== */

:root {
    --navy: #1B2A4A;
    --navy-light: #2C3E6B;
    --navy-dark: #0F1B33;
    --gold: #C4A35A;
    --gold-light: #D4B76A;
    --cream: #FDF8F0;
    --cream-dark: #F5EDE0;
    --text: #2C2C2C;
    --text-light: #6B6B6B;
    --border: #D5CFC5;
    --border-light: #E8E2D8;
    --white: #FFFFFF;
    --success: #2E7D4F;
    --danger: #C0392B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- Page Container ---- */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ---- Top Bar ---- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--navy);
    position: sticky;
    top: 0;
    background: var(--cream);
    z-index: 100;
}

.logo {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.top-bar-right {
    display: flex;
    gap: 0.5rem;
}

/* ---- Buttons ---- */
.btn {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--navy-light);
}

.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
}

.btn-outline:hover {
    background: var(--navy);
    color: var(--white);
}

/* ---- Sections ---- */
.section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    letter-spacing: 0.03em;
}

.section-title.accent {
    border-bottom: 2px solid var(--gold);
}

.col-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--navy-light);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Layout ---- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.two-col-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ---- Form Elements ---- */
.form-row {
    margin-bottom: 0.65rem;
}

.form-row label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--navy-light);
    box-shadow: 0 0 0 2px rgba(27, 42, 74, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row select {
    appearance: auto;
}

.measure-input {
    max-width: 140px;
    text-align: center;
    font-weight: 500;
}

/* ---- Checkbox Rows ---- */
.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    font-weight: 400;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--navy);
    flex-shrink: 0;
}

/* ---- Fabrics Table ---- */
.fabrics-table-wrap {
    overflow-x: auto;
}

.fabrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.fabrics-table th {
    background: var(--navy);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fabrics-table th:first-child {
    border-radius: 3px 0 0 0;
}

.fabrics-table th:last-child {
    border-radius: 0 3px 0 0;
}

.fabrics-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.fabrics-table .row-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.fabrics-table input[type="text"] {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.85rem;
}

.fabrics-table input[type="text"]:focus {
    outline: none;
    border-color: var(--navy-light);
}

.fabrics-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    cursor: pointer;
}

/* ---- Body Type Selection ---- */
.helper-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.body-type-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.body-type-option {
    cursor: pointer;
}

.body-type-option input[type="radio"] {
    display: none;
}

.body-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    transition: all 0.15s ease;
    min-width: 72px;
}

.body-type-card:hover {
    border-color: var(--navy-light);
    background: rgba(27, 42, 74, 0.03);
}

.body-type-option input[type="radio"]:checked + .body-type-card {
    border-color: var(--navy);
    background: rgba(27, 42, 74, 0.06);
    box-shadow: 0 0 0 1px var(--navy);
}

.body-type-card span {
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    text-align: center;
}

.body-svg {
    width: 44px;
    height: 88px;
    color: var(--navy);
}

.body-svg.shoulder-svg {
    width: 44px;
    height: 58px;
}

/* ---- Bottom Actions ---- */
.bottom-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-top: 2px solid var(--navy);
    margin-top: 0.5rem;
}

.bottom-actions > div {
    display: flex;
    gap: 0.5rem;
}

/* ---- Save Notification ---- */
.save-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
}

.save-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* ---- Print Styles ---- */
.print-only {
    display: none;
}

.print-header {
    text-align: center;
    margin-bottom: 1rem;
}

.print-header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    color: var(--navy);
}

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        background: white;
        font-size: 11px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 0.75rem;
        padding: 1rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        border: none;
        border-bottom: 1px solid #999;
        border-radius: 0;
        padding: 0.2rem 0.3rem;
        font-size: 10px;
    }

    .fabrics-table th {
        background: var(--navy) !important;
        color: white !important;
    }

    .body-type-card {
        border: 1px solid #ccc;
        padding: 0.3rem;
    }

    .body-type-option input[type="radio"]:checked + .body-type-card {
        border: 2px solid #000;
        background: #f0f0f0;
    }

    .save-notification {
        display: none !important;
    }

    .bottom-actions {
        display: none !important;
    }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .three-col {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .page {
        padding: 0 0.75rem 2rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.3rem;
        text-align: center;
    }

    .top-bar-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .top-bar-right .btn {
        text-align: center;
        padding: 0.45rem 0.5rem;
        font-size: 0.8rem;
    }

    .two-col-inline {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        border-radius: 4px;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .col-heading {
        font-size: 0.95rem;
    }

    .body-type-grid {
        justify-content: center;
    }

    .body-type-card {
        min-width: 60px;
        padding: 0.4rem;
    }

    .body-type-card svg {
        width: 40px;
        height: 80px;
    }

    .body-type-card span {
        font-size: 0.6rem;
    }

    .fabrics-table th {
        padding: 0.4rem 0.4rem;
        font-size: 0.7rem;
    }

    .fabrics-table td {
        padding: 0.3rem 0.3rem;
    }

    .fabrics-table .row-label {
        font-size: 0.7rem;
    }

    .description-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 13px;
    }

    .top-bar-right {
        grid-template-columns: 1fr 1fr;
    }

    .body-type-card {
        min-width: 55px;
    }
}

/* ========================================
   Measurement Guide Page Styles
   ======================================== */

.guide-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.guide-page h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: var(--navy);
    text-align: center;
    margin-bottom: 0.25rem;
}

.guide-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.guide-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.guide-section h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.guide-section h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    color: var(--navy-light);
    margin-bottom: 0.6rem;
    margin-top: 1.2rem;
}

.guide-section h3:first-child {
    margin-top: 0;
}

.guide-section p {
    margin-bottom: 0.6rem;
    line-height: 1.6;
    font-size: 0.92rem;
}

.guide-section ul,
.guide-section ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.guide-section li {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.guide-important {
    background: #FFF8E1;
    border-left: 4px solid var(--gold);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}

.guide-important strong {
    color: var(--navy);
}

.measure-diagram {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.measure-diagram-svg {
    flex-shrink: 0;
}

.measure-list {
    flex: 1;
    min-width: 280px;
}

.measure-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.measure-item .label {
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

.body-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.body-ref-card {
    text-align: center;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

.body-ref-card svg {
    display: block;
    margin: 0 auto 0.4rem;
}

.body-ref-card .body-ref-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--navy);
}

.body-ref-card .body-ref-desc {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.body-ref-grid-lg {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.body-ref-card-lg {
    padding: 1rem 0.75rem;
    min-width: auto;
}

.body-ref-card-lg svg {
    display: block;
    margin: 0 auto 0.6rem;
}

.body-ref-card-lg .body-ref-label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.body-ref-card-lg .body-ref-desc {
    font-size: 0.73rem;
    line-height: 1.4;
}

.ref-image-block {
    text-align: center;
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    background: #FDFAF5;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

.ref-image-block img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media print {
    .ref-image-block {
        break-inside: avoid;
        padding: 0.5rem;
        border: 1px solid #ccc;
    }

    .ref-image-block img {
        max-height: 200px;
        width: auto;
    }
}

.guide-btn-bar {
    text-align: center;
    margin-bottom: 1.5rem;
}

@media print {
    .guide-page {
        padding: 0;
        max-width: none;
    }

    .guide-btn-bar {
        display: none !important;
    }

    .guide-section {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* ---- Guide Mobile ---- */
@media (max-width: 600px) {
    .guide-page {
        padding: 1rem 0.75rem;
    }

    .guide-page h1 {
        font-size: 1.5rem;
    }

    .guide-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .guide-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 4px;
    }

    .guide-section h2 {
        font-size: 1.2rem;
    }

    .guide-section h3 {
        font-size: 1rem;
    }

    .measure-diagram {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .measure-diagram-svg svg {
        max-width: 200px;
        height: auto;
    }

    .measure-list {
        min-width: 0;
        width: 100%;
    }

    .ref-image-block {
        padding: 0.5rem;
        margin: 0.75rem 0 1rem;
    }

    .helper-text {
        font-size: 0.82rem;
    }
}
