/* =========================================================
   GTG Size Chart – Frontend Styles
   Compatible with Marriwe theme & Elementor Pro
   ========================================================= */

/* ── Scroll lock ─────────────────────────────────────────── */
html.gtg-sc-scroll-lock,
html.gtg-sc-scroll-lock body {
    overflow: hidden !important;
}

/* ── Size Chart Button ────────────────────────────────────── */
.gtg-sc-button-wrap {
    margin-bottom: 12px;
}

.gtg-size-chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    border-radius: 3px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.gtg-size-chart-btn:hover,
.gtg-size-chart-btn:focus {
    background: #111;
    color: #fff;
    outline: none;
}

/* ── Modal Overlay ────────────────────────────────────────── */
.gtg-sc-modal {
    position: fixed;
    inset: 0;                        /* top/right/bottom/left: 0 */
    /* FIX 2: raised from 999999 → 2147483647 (max z-index) so we always
       clear Quick View modals regardless of what z-index they use.
       The modal is also moved to <body> by JS (see gtg-size-chart.js)
       to escape any stacking context created by the Quick View overlay. */
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gtg-sc-modal--open {
    opacity: 1;
    pointer-events: auto;
}

.gtg-sc-modal--closed,
.gtg-sc-modal--closing {
    opacity: 0;
    pointer-events: none;
}

/* ── Backdrop ─────────────────────────────────────────────── */
.gtg-sc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    z-index: 0;
}

/* ── Dialog ───────────────────────────────────────────────── */
.gtg-sc-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-12px);
    transition: transform 0.25s ease;
}

.gtg-sc-modal--open .gtg-sc-modal__dialog {
    transform: translateY(0);
}

/* ── Header ───────────────────────────────────────────────── */
.gtg-sc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.gtg-sc-modal__title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
}

.gtg-sc-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    color: #555;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.gtg-sc-modal__close:hover,
.gtg-sc-modal__close:focus {
    color: #111;
    background: #f0f0f0;
    outline: none;
}

/* ── Body / Content ───────────────────────────────────────── */
.gtg-sc-modal__body {
    overflow-y: auto;
    padding: 20px;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.gtg-sc-modal__content {
    min-height: 60px;
}

/* ── Chart Image ──────────────────────────────────────────── */
.gtg-sc-chart-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 2px;
}

/* ── Chart Table ──────────────────────────────────────────── */
.gtg-sc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gtg-sc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.gtg-sc-table th,
.gtg-sc-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
}

.gtg-sc-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    color: #111;
}

.gtg-sc-table tbody tr:nth-child(even) td {
    background: #fafafa;
}

.gtg-sc-table tbody tr:hover td {
    background: #f0f0f0;
}

/* ── Spinner ──────────────────────────────────────────────── */
.gtg-sc-spinner {
    width: 36px;
    height: 36px;
    margin: 30px auto;
    border: 3px solid #e5e5e5;
    border-top-color: #111;
    border-radius: 50%;
    animation: gtg-sc-spin 0.7s linear infinite;
    display: block;
}

@keyframes gtg-sc-spin {
    to { transform: rotate(360deg); }
}

/* ── Error / notice messages ──────────────────────────────── */
.gtg-sc-error {
    color: #c0392b;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.gtg-sc-notice {
    color: #555;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .gtg-sc-modal__dialog {
        width: 95%;
        max-height: 92vh;
    }

    .gtg-sc-modal__header {
        padding: 12px 14px;
    }

    .gtg-sc-modal__body {
        padding: 14px;
    }

    .gtg-sc-modal__title {
        font-size: 15px;
    }

    .gtg-sc-table th,
    .gtg-sc-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}
