/* ============================================
   Guia de Medidas - Frontend
   ============================================ */

/* Botão Modal */
.gmwc-open-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #1a1a1a;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    margin: 15px 0 0 0;
    transition: all 0.2s ease;
}
.gmwc-open-modal:hover {
    background: #1a1a1a;
    color: #fff;
}
.gmwc-open-modal .gmwc-icon { font-size: 16px; }

/* Container principal */
.gmwc-guide {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 20px 0;
    flex-wrap: wrap;
}

.gmwc-guide__image {
    flex: 0 0 320px;
    max-width: 320px;
}

.gmwc-image-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    overflow: hidden;
}
.gmwc-image-container img.gmwc-manequim {
    width: 100%;
    height: auto;
    display: block;
}
.gmwc-no-image {
    padding: 80px 20px;
    text-align: center;
    color: #999;
    background: #f0f0f0;
    font-size: 14px;
}

/* ============================================
   Setas: ocultas por padrao, aparecem no hover
   ============================================ */
.gmwc-arrow {
    position: absolute;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    height: 80px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 5;
}

.gmwc-arrow.is-active {
    opacity: 1;
    visibility: visible;
}

.gmwc-arrow__svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gmwc-arrow__custom {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.gmwc-guide__instructions {
    font-size: 13px;
    color: #555;
    text-align: center;
    line-height: 1.5;
    margin: 15px 10px 0;
}

/* ============================================
   Tabela
   ============================================ */
.gmwc-guide__table {
    flex: 1;
    min-width: 320px;
}

.gmwc-guide__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.gmwc-table {
    width: 100%;
    border-collapse: collapse;
}

.gmwc-table th,
.gmwc-table td {
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
    transition: background 0.2s ease;
}

.gmwc-table thead th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #666;
    text-transform: uppercase;
    border-bottom: 2px solid #1a1a1a;
}

.gmwc-table tbody td { font-size: 14px; color: #333; }
.gmwc-table tbody td:first-child { color: #1a1a1a; }

.gmwc-trigger {
    cursor: pointer;
}

.gmwc-table .gmwc-trigger.is-hovered {
    background: #fafafa;
    color: #000;
}
.gmwc-table thead th.gmwc-trigger.is-hovered {
    background: #f0f0f0;
}

.gmwc-guide__unit {
    font-size: 13px;
    color: #777;
    margin-top: 15px;
}

/* ============================================
   Modal
   ============================================ */
.gmwc-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}
.gmwc-modal.is-open { display: flex; }
.gmwc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}
.gmwc-modal__content {
    position: relative;
    background: #fff;
    width: 92%;
    max-width: 900px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 30px 35px;
    border-radius: 4px;
}
.gmwc-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    width: 32px;
    height: 32px;
    line-height: 1;
}
.gmwc-modal__close:hover { color: #000; }

@media (max-width: 768px) {
    .gmwc-guide {
        flex-direction: column;
        align-items: center;
    }
    .gmwc-guide__image {
        flex: 0 0 auto;
        max-width: 260px;
    }
    .gmwc-guide__table { width: 100%; }
    .gmwc-modal__content { padding: 30px 20px; }
}

/* ============================================
   VIX Digital - Modal acionado pelo menu Guia de Medidas
   Desktop + Mobile
   ============================================ */
html.gmwc-modal-open,
body.gmwc-modal-open {
    overflow: hidden !important;
}

/* A aba continua no menu, mas seu conteúdo não expande na página. */
#tab-gmwc_guide,
.woocommerce-Tabs-panel--gmwc_guide {
    display: none !important;
}

.gmwc-tab-placeholder {
    display: none !important;
}

.gmwc-modal {
    padding: 24px;
}

.gmwc-modal__overlay {
    background: rgba(20, 14, 11, 0.68);
    backdrop-filter: blur(2px);
}

.gmwc-modal__content {
    width: min(1040px, calc(100vw - 48px));
    max-width: 1040px;
    max-height: min(88vh, 860px);
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
    outline: none;
}

.gmwc-modal__header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 16px 22px 16px 28px;
    background: #fff;
    border-bottom: 1px solid #eee8e4;
}

.gmwc-modal__title {
    margin: 0 !important;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    color: #4d3327;
}

.gmwc-modal__close {
    position: static;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.gmwc-modal__close:hover {
    background: #f4efec;
    transform: rotate(3deg);
}

.gmwc-modal__body {
    max-height: calc(min(88vh, 860px) - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px 30px 30px;
}

.gmwc-modal .gmwc-guide {
    flex-wrap: nowrap;
    gap: 42px;
    padding: 0;
}

.gmwc-modal .gmwc-guide__image {
    flex: 0 0 34%;
    max-width: 340px;
}

.gmwc-modal .gmwc-guide__table {
    min-width: 0;
}

.gmwc-modal .gmwc-guide__title {
    margin-top: 0;
}

.gmwc-modal .gmwc-table {
    min-width: 520px;
}

.gmwc-modal .gmwc-guide__table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .gmwc-modal {
        align-items: flex-end;
        padding: 0;
    }

    .gmwc-modal__content {
        width: 100%;
        max-width: none;
        max-height: 94dvh;
        border-radius: 16px 16px 0 0;
    }

    .gmwc-modal__header {
        min-height: 60px;
        padding: 12px 14px 12px 18px;
    }

    .gmwc-modal__title {
        font-size: 19px;
    }

    .gmwc-modal__close {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 28px;
    }

    .gmwc-modal__body {
        max-height: calc(94dvh - 60px);
        padding: 18px 16px 24px;
    }

    .gmwc-modal .gmwc-guide {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .gmwc-modal .gmwc-guide__image {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .gmwc-modal .gmwc-guide__instructions {
        margin-left: 0;
        margin-right: 0;
    }

    .gmwc-modal .gmwc-guide__table {
        width: 100%;
        min-width: 0;
        overflow-x: auto;
    }

    .gmwc-modal .gmwc-guide__title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .gmwc-modal .gmwc-table {
        min-width: 500px;
    }

    .gmwc-modal .gmwc-table th,
    .gmwc-modal .gmwc-table td {
        padding: 11px 9px;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    .gmwc-modal__body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .gmwc-modal .gmwc-guide__image {
        max-width: 240px;
    }
}

/* ============================================
   VIX Digital - v1.3.1
   Refinamento visual: imagem alinhada à altura da tabela
   e botão de fechamento mais discreto.
   ============================================ */
@media (min-width: 769px) {
    .gmwc-modal .gmwc-guide__image {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        flex: 0 0 32%;
        max-width: 320px;
    }

    .gmwc-modal .gmwc-image-container {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        max-height: 350px;
        background: transparent;
    }

    .gmwc-modal .gmwc-image-container img.gmwc-manequim {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 350px !important;
        object-fit: contain !important;
        margin: 0 auto;
    }

    .gmwc-modal .gmwc-guide__instructions {
        width: 100%;
        margin-top: 12px;
    }
}

.gmwc-modal .gmwc-modal__close {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #4d3327 !important;
    padding: 0 !important;
}

.gmwc-modal .gmwc-modal__close:hover,
.gmwc-modal .gmwc-modal__close:focus {
    background: #f4efec !important;
    color: #2e1d16 !important;
    outline: none !important;
}

@media (max-width: 768px) {
    .gmwc-modal .gmwc-image-container {
        display: flex;
        justify-content: center;
        background: transparent;
    }

    .gmwc-modal .gmwc-image-container img.gmwc-manequim {
        width: auto !important;
        max-width: 100% !important;
        max-height: 320px !important;
        object-fit: contain !important;
        margin: 0 auto;
    }
}
