/**
 * Size Guide Modal
 *
 * Lightweight overlay modal with size chart tables.
 * Matches FISHOOZ design: ocean blues, Montserrat, alternating rows.
 * Mobile-first — nearly full-screen on small viewports.
 */

/* ==========================================================================
   BACKDROP + MODAL SHELL
   ========================================================================== */

.sg-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sg-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.sg-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 58, 71, 0.55);
}

.sg-modal {
    position: relative;
    width: 92vw;
    max-width: 520px;
    max-height: 88vh;
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.25s ease;
}

.sg-overlay.is-open .sg-modal {
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.sg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--sky-light);
    flex-shrink: 0;
}

.sg-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.sg-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-medium);
    transition: background 0.15s ease, color 0.15s ease;
}

.sg-close:hover {
    background: var(--sky-light);
    color: var(--text-dark);
}

/* ==========================================================================
   BODY (scrollable)
   ========================================================================== */

.sg-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   TABS (Men's / Women's)
   ========================================================================== */

.sg-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--sky-pale);
    border-radius: var(--radius-md);
    padding: 4px;
}

.sg-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sg-tab.is-active {
    background: var(--white);
    color: var(--ocean-deep);
    box-shadow: var(--shadow-sm);
}

.sg-tab:hover:not(.is-active) {
    color: var(--text-dark);
}

/* ==========================================================================
   CHART PANELS
   ========================================================================== */

.sg-chart {
    display: none;
}

.sg-chart.is-active {
    display: block;
}

/* ==========================================================================
   TABLE
   ========================================================================== */

.sg-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-display);
    font-size: 14px;
}

.sg-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--ocean-pale);
}

.sg-table tbody tr {
    border-bottom: 1px solid var(--sky-light);
}

.sg-table tbody tr:nth-child(even) {
    background: var(--sky-pale);
}

.sg-table tbody td {
    padding: 11px 14px;
    color: var(--text-dark);
}

.sg-table tbody td:first-child {
    font-weight: 600;
    color: var(--ocean-deep);
}

/* ==========================================================================
   DISCLAIMER
   ========================================================================== */

.sg-disclaimer {
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--sky-pale);
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-medium);
}

/* ==========================================================================
   BODY SCROLL LOCK
   ========================================================================== */

body.sg-no-scroll {
    overflow: hidden;
}

/* ==========================================================================
   MOBILE: nearly full-screen
   ========================================================================== */

@media (max-width: 599px) {
    .sg-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .sg-header {
        padding: 16px 20px 14px;
    }

    .sg-body {
        padding: 16px 20px 20px;
    }

    .sg-table {
        font-size: 13px;
    }

    .sg-table thead th,
    .sg-table tbody td {
        padding: 10px 10px;
    }
}
