/**
 * WC Accordion Shop - CSS v1.7.0
 * Paleta: #9B090D / #BF1534 / #fcfcfc / #11181c
 * box-shadow: rgba(100,100,111,0.2) 0px 7px 29px 0px
 */

:root {
    --wcas-primary:    #BF1534;
    --wcas-dk:         #9B090D;
    --wcas-lt:         #fdf0f2;
    --wcas-text:       #11181c;
    --wcas-muted:      #555;
    --wcas-border:     #e2e2e2;
    --wcas-bg:         #fcfcfc;
    --wcas-bg-alt:     #fafafa;
    --wcas-shadow:     rgba(100,100,111,.2) 0px 7px 29px 0px;
    --wcas-radius:     8px;
    --wcas-ease:       .22s ease;
}

/* ================================================================== */
/*  BOTÓN VER OPCIONES                                                */
/* ================================================================== */
.wcas-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 14px;
    border: 2px solid var(--wcas-primary);
    border-radius: var(--wcas-radius);
    background: transparent;
    color: var(--wcas-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--wcas-ease);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.wcas-expand-btn:hover,
.wcas-expand-btn.wcas-active {
    background: var(--wcas-primary);
    color: #fcfcfc;
}
.wcas-expand-btn .wcas-btn-icon {
    font-size: 9px;
    transition: transform var(--wcas-ease);
}
.wcas-expand-btn.wcas-active .wcas-btn-icon {
    transform: rotate(180deg);
}
li.product.wcas-product-active {
    outline: 2px solid var(--wcas-primary);
    border-radius: var(--wcas-radius);
}

/* Ocultar botones estándar de WC (respaldo CSS) */
.wcas-accordion-active ul.products li.product:not(.wcas-expansion-panel) > a.button,
.wcas-accordion-active ul.products li.product:not(.wcas-expansion-panel) .add_to_cart_button,
.wcas-accordion-active ul.products li.product:not(.wcas-expansion-panel) .product_type_variable,
.wcas-accordion-active ul.products li.product:not(.wcas-expansion-panel) a.added_to_cart {
    display: none !important;
}

/* ================================================================== */
/*  PANEL — fuerza ancho 100% en CUALQUIER layout                    */
/*  Float (Storefront legacy):  clear:both + float:none              */
/*  Flexbox:                    flex-basis:100%                       */
/*  CSS Grid:                   grid-column:1/-1                      */
/* ================================================================== */
li.wcas-expansion-panel,
ul.products li.wcas-expansion-panel,
.woocommerce ul.products li.wcas-expansion-panel,
.woocommerce-page ul.products li.wcas-expansion-panel,
/* nth-child overrides que los temas usan para anchos alternados */
ul.products li.wcas-expansion-panel:nth-child(2n),
ul.products li.wcas-expansion-panel:nth-child(3n),
ul.products li.wcas-expansion-panel:nth-child(4n),
.woocommerce ul.products.columns-2 li.wcas-expansion-panel,
.woocommerce ul.products.columns-3 li.wcas-expansion-panel,
.woocommerce ul.products.columns-4 li.wcas-expansion-panel,
.woocommerce-page ul.products.columns-2 li.wcas-expansion-panel,
.woocommerce-page ul.products.columns-3 li.wcas-expansion-panel,
.woocommerce-page ul.products.columns-4 li.wcas-expansion-panel {
    /* Float layout */
    clear: both !important;
    float: none !important;
    /* Flex layout */
    flex-basis: 100% !important;
    flex-grow: 1 !important;
    /* Grid layout */
    grid-column: 1 / -1 !important;
    /* Ancho y box model */
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    /* Espaciado */
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
    /* Mostrar como bloque */
    display: block !important;
    list-style: none !important;
    /* Reset cualquier transform o posición del tema */
    position: static !important;
    transform: none !important;
    box-sizing: border-box !important;
}

/* ── Panel interior ── */
.wcas-panel-inner {
    background: var(--wcas-bg);
    border: 1px solid var(--wcas-border);
    border-radius: var(--wcas-radius);
    box-shadow: var(--wcas-shadow);
    overflow: hidden;
}

/* ── Header ── */
.wcas-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--wcas-bg-alt);
    border-bottom: 1px solid var(--wcas-border);
}
.wcas-panel-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.wcas-panel-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--wcas-border);
    background: #fcfcfc;
    padding: 4px;
    flex-shrink: 0;
}
.wcas-panel-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.wcas-panel-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--wcas-text);
    line-height: 1.2;
}
.wcas-panel-sku   { font-size: 11px; color: var(--wcas-muted); letter-spacing: .3px; }
.wcas-panel-price { font-size: 15px; font-weight: 700; color: var(--wcas-dk); }
.wcas-panel-price del { color: #aaa; font-weight: 400; font-size: 13px; }
.wcas-panel-price ins { text-decoration: none; }

.wcas-panel-close {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    font-size: 17px; color: var(--wcas-muted);
    cursor: pointer; border-radius: 50%;
    transition: all var(--wcas-ease);
    flex-shrink: 0; margin-left: 12px;
}
.wcas-panel-close:hover { background: var(--wcas-lt); color: var(--wcas-dk); }

/* ── Descripción ── */
.wcas-panel-description {
    padding: 10px 18px;
    font-size: 13px; color: var(--wcas-muted); line-height: 1.5;
    border-bottom: 1px solid var(--wcas-border);
}
.wcas-panel-description p:last-child { margin-bottom: 0; }

/* ================================================================== */
/*  TABLA DE VARIACIONES                                              */
/* ================================================================== */
.wcas-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.wcas-variations-table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.wcas-variations-table thead {
    background: var(--wcas-dk); color: #fcfcfc;
}
.wcas-variations-table th {
    padding: 10px 14px; text-align: left;
    font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
    color: #11181c;
}
.wcas-variations-table th.wcas-th-qty { text-align: center; min-width: 136px; }
.wcas-variations-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle; color: var(--wcas-text);
}
.wcas-variations-table tbody tr:hover    { background: var(--wcas-lt); }
.wcas-variations-table tbody tr:last-child td { border-bottom: none; }
.wcas-variations-table tbody tr.wcas-out-of-stock { opacity: .45; }
.wcas-cell-price { font-weight: 600; white-space: nowrap; color: var(--wcas-dk); }
.wcas-cell-price del { color: #aaa; font-weight: 400; }
.wcas-cell-qty   { text-align: center; }

/* ── Foto y descripción de la variación ── */
.wcas-variations-table th.wcas-th-img { width: 76px; }
.wcas-cell-img { width: 76px; }
.wcas-cell-img a { display: inline-block; line-height: 0; }
.wcas-var-thumb {
    width: 56px; height: 56px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--wcas-border);
    background: #fcfcfc;
    padding: 3px;
    transition: transform var(--wcas-ease);
}
.wcas-var-thumb { cursor: zoom-in; }
.wcas-cell-img a:hover .wcas-var-thumb { border-color: var(--wcas-primary); }

/* Popup de foto (colgado de <body>, no de la tabla) */
.wcas-zoom-popup {
    display: none;
    position: fixed;
    z-index: 999999;
    background: #fff;
    border: 1px solid var(--wcas-border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    padding: 8px;
    box-sizing: border-box;
}
.wcas-zoom-popup.wcas-zoom-open { display: block; }
.wcas-zoom-popup img {
    display: block !important;
    width: 100% !important; height: 100% !important;
    max-width: none !important;
    object-fit: contain;
}
.wcas-cell-desc { min-width: 220px; line-height: 1.4; color: var(--wcas-muted); }

/* ── Controles cantidad ── */
.wcas-qty-wrap {
    display: inline-flex; align-items: stretch;
    border: 1.5px solid var(--wcas-border);
    border-radius: 6px; overflow: hidden; background: #fcfcfc;
}
.wcas-qty-minus,
.wcas-qty-plus {
    width: 32px; height: 34px;
    border: none; background: var(--wcas-bg-alt);
    color: var(--wcas-text);
    font-size: 17px; font-weight: 500;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background var(--wcas-ease); padding: 0; line-height: 1;
}
.wcas-qty-minus:hover,
.wcas-qty-plus:hover  { background: var(--wcas-lt); color: var(--wcas-dk); }
.wcas-qty-input {
    width: 50px; height: 34px; border: none;
    border-left: 1.5px solid var(--wcas-border);
    border-right: 1.5px solid var(--wcas-border);
    text-align: center; font-size: 14px; font-weight: 600;
    background: #fcfcfc; color: var(--wcas-text);
    -moz-appearance: textfield;
}
.wcas-qty-input:focus { outline: none; background: var(--wcas-lt); }
.wcas-qty-input::-webkit-outer-spin-button,
.wcas-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wcas-no-stock { font-size: 11px; color: #c0392b; font-style: italic; }

/* ================================================================== */
/*  PRODUCTO SIMPLE                                                   */
/* ================================================================== */
.wcas-simple-row {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; padding: 20px; flex-wrap: wrap;
}
.wcas-simple-price { font-size: 22px; font-weight: 700; color: var(--wcas-dk); }
.wcas-simple-price del { color: #aaa; font-weight: 400; font-size: 15px; }
.wcas-simple-price ins { text-decoration: none; }

/* ================================================================== */
/*  ACCIONES                                                          */
/* ================================================================== */
.wcas-panel-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 14px; padding: 12px 18px;
    background: var(--wcas-bg-alt); border-top: 1px solid var(--wcas-border);
    flex-wrap: wrap;
}
/* Compartir (AddToAny): a la izquierda del botón; en la vista rápida, bajo el precio */
.wcas-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-right: auto; }
.wcas-share button.wcas-share-toggle {
    width: 36px; height: 36px; min-height: 0; padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1px solid var(--wcas-border); border-radius: 50%;
    background: #fff; color: var(--wcas-dk); cursor: pointer;
    box-shadow: none; transition: all var(--wcas-ease);
}
.wcas-share button.wcas-share-toggle:hover,
.wcas-share.wcas-share-open button.wcas-share-toggle {
    background: var(--wcas-primary); border-color: var(--wcas-primary); color: #fff;
}
/* Contorno de foco solo con teclado (no queda el anillo después de un clic) */
.wcas-share button.wcas-share-toggle:focus:not(:focus-visible) { outline: none; }
.wcas-share-menu[hidden] { display: none !important; }
.wcas-share-menu { display: flex; animation: wcas-share-in .18s ease-out; }
@keyframes wcas-share-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.wcas-share .a2a_kit { display: flex; flex-wrap: wrap; gap: 4px; line-height: 0; }
.wcas-share .a2a_kit a { padding: 0 !important; }
/* Botón universal con imagen propia (config. "Custom" de AddToAny): mismo tamaño que los íconos */
.wcas-share .a2a_kit .a2a_dd img { width: 32px !important; height: 32px !important; object-fit: contain; }
.wcas-qv-text .wcas-share { margin: 0 0 14px; }
.wcas-share.wcas-share-page { margin: 14px 0; }
.wcas-add-to-cart-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 26px; border: none;
    border-radius: var(--wcas-radius);
    background: var(--wcas-primary); color: #fcfcfc;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all var(--wcas-ease);
    text-transform: uppercase; letter-spacing: .4px; line-height: 1;
}
.wcas-add-to-cart-btn:hover   { background: var(--wcas-dk); box-shadow: 0 4px 14px rgba(155,9,13,.35); }
.wcas-add-to-cart-btn:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }

.wcas-message { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.wcas-msg-success { background: #e8f5e9; color: #2e7d32; }
.wcas-msg-error   { background: #ffebee; color: var(--wcas-dk); }
.wcas-msg-warning { background: #fcfcfc8e1; color: #e65100; }

/* ================================================================== */
/*  LOADING                                                           */
/* ================================================================== */
.wcas-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 36px 20px;
    color: var(--wcas-muted); font-size: 14px;
}
.wcas-spinner {
    width: 22px; height: 22px;
    border: 3px solid #eee; border-top-color: var(--wcas-primary);
    border-radius: 50%; flex-shrink: 0;
    animation: wcas-spin .65s linear infinite;
}
@keyframes wcas-spin { to { transform: rotate(360deg); } }
.wcas-error { padding: 20px; text-align: center; color: var(--wcas-dk); font-size: 14px; }

/* ================================================================== */
/*  RESPONSIVE                                                        */
/* ================================================================== */
@media (max-width: 768px) {
    .wcas-panel-header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
    .wcas-panel-thumb  { width: 50px; height: 50px; }
    .wcas-panel-title  { font-size: 15px; }

    .wcas-variations-table thead { display: none; }
    .wcas-variations-table tbody tr {
        display: block; padding: 10px 14px;
        border-bottom: 2px solid var(--wcas-border);
    }
    .wcas-variations-table td {
        display: flex; justify-content: space-between;
        align-items: center; padding: 5px 0;
        border-bottom: 1px solid #f0f0f0; font-size: 13px;
    }
    .wcas-variations-table td:last-child { border-bottom: none; padding-top: 8px; }
    .wcas-cell-img { width: auto; }
    .wcas-cell-img:empty { display: none; }
    .wcas-cell-desc { min-width: 0; gap: 12px; text-align: right; }
    .wcas-variations-table td::before {
        content: attr(data-label); font-weight: 700;
        color: var(--wcas-text); font-size: 11px;
        text-transform: uppercase; letter-spacing: .3px;
    }
    .wcas-panel-actions { flex-direction: column; gap: 10px; }
    .wcas-panel-actions .wcas-share { margin-right: 0; justify-content: center; }
    .wcas-panel-actions .wcas-share-menu { flex-basis: 100%; justify-content: center; }
    .wcas-panel-actions .wcas-share .a2a_kit { justify-content: center; }
    .wcas-add-to-cart-btn { width: 100%; justify-content: center; }
    .wcas-simple-row { flex-direction: column; gap: 14px; }
}

/* ================================================================== */
/*  VISTA RÁPIDA DE VARIACIÓN (v1.7.0)                                */
/*  Desktop: ventana centrada. Celular: pantalla completa.           */
/* ================================================================== */
.wcas-variations-table tbody tr.wcas-var-row { cursor: pointer; }
.wcas-panel-thumb.wcas-qv-trigger,
.wcas-panel-title.wcas-qv-trigger { cursor: pointer; }
.wcas-panel-title.wcas-qv-trigger:hover { color: var(--wcas-dk); }
.wcas-qv-link {
    border: none; background: none; padding: 4px 0;
    font-size: 13px; font-weight: 600; color: var(--wcas-dk);
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.wcas-qv-link:hover { color: var(--wcas-primary); }

html.wcas-qv-lock,
html.wcas-qv-lock body { overflow: hidden !important; }

.wcas-qv {
    display: none;
    position: fixed; inset: 0;
    z-index: 999990;
    align-items: center; justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.wcas-qv.wcas-qv-open { display: flex; }
.wcas-qv-backdrop {
    position: absolute; inset: 0;
    background: rgba(17,24,28,.6);
}
.wcas-qv-box {
    position: relative;
    width: 100%; max-width: 980px;
    max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
    background: var(--wcas-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
    color: var(--wcas-text);
}
.wcas-qv-content {
    display: flex; min-height: 0; flex: 1;
}
.wcas-qv-content > .wcas-loading,
.wcas-qv-content > .wcas-error { flex: 1; min-height: 240px; }

.wcas-qv .wcas-qv-close {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    width: 44px; height: 44px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--wcas-border); border-radius: 50%;
    background: #fff; color: var(--wcas-text);
    font-size: 20px; line-height: 1; font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    cursor: pointer;
}
.wcas-qv .wcas-qv-close:hover { background: var(--wcas-primary); border-color: var(--wcas-primary); color: #fff; }

/* ── Galería ── */
.wcas-qv-gallery {
    position: relative;
    flex: 0 0 52%;
    background: #fff;
    border-right: 1px solid var(--wcas-border);
    min-width: 0;
}
.wcas-qv-track {
    display: flex; height: 100%;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.wcas-qv-track::-webkit-scrollbar { display: none; }
.wcas-qv-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; box-sizing: border-box;
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 48px);
}
.wcas-qv-slide img {
    display: block !important;
    width: 100% !important; height: 100% !important;
    max-width: 100% !important;
    object-fit: contain;
    user-select: none;
}
.wcas-qv .wcas-qv-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--wcas-border); border-radius: 50%;
    background: rgba(255,255,255,.92); color: var(--wcas-text);
    font-size: 26px; line-height: 1;
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.wcas-qv .wcas-qv-arrow:hover { background: var(--wcas-primary); border-color: var(--wcas-primary); color: #fff; }
.wcas-qv-prev { left: 10px; }
.wcas-qv-next { right: 10px; }
.wcas-qv-dots {
    position: absolute; left: 0; right: 0; bottom: 12px;
    display: flex; justify-content: center; gap: 8px;
}
.wcas-qv .wcas-qv-dot {
    width: 10px; height: 10px; padding: 0; margin: 0;
    border: none; border-radius: 50%;
    background: #ccc; cursor: pointer;
}
.wcas-qv .wcas-qv-dot.wcas-qv-dot-on { background: var(--wcas-primary); }

/* ── Información ── */
.wcas-qv-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
}
.wcas-qv-text {
    flex: 1; overflow-y: auto;
    padding: 24px 64px 16px 24px;
    font-size: 14px; line-height: 1.55; color: var(--wcas-muted);
}
.wcas-qv-title {
    margin: 0 0 12px; font-size: 20px; font-weight: 700;
    line-height: 1.25; color: var(--wcas-text);
}
.wcas-qv-price { margin: -4px 0 14px; font-size: 20px; font-weight: 700; color: var(--wcas-dk); }
.wcas-qv-price del { color: #aaa; font-weight: 400; font-size: 15px; }
.wcas-qv-price ins { text-decoration: none; }
.wcas-qv-desc { color: var(--wcas-text); }
.wcas-qv-pdesc { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--wcas-border); }
.wcas-qv-pdesc h4 {
    margin: 0 0 8px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px; color: var(--wcas-text);
}
.wcas-qv-text p:last-child { margin-bottom: 0; }
.wcas-qv-text img { max-width: 100%; height: auto; }

.wcas-qv-actions {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 14px 24px;
    background: var(--wcas-bg-alt);
    border-top: 1px solid var(--wcas-border);
}
.wcas-qv .wcas-qv-add {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; padding: 11px 22px; margin: 0;
    border: none; border-radius: var(--wcas-radius);
    background: var(--wcas-primary); color: #fcfcfc;
    font-size: 14px; font-weight: 700; line-height: 1;
    text-transform: uppercase; letter-spacing: .4px;
    cursor: pointer; transition: all var(--wcas-ease);
}
.wcas-qv .wcas-qv-add:hover    { background: var(--wcas-dk); }
.wcas-qv .wcas-qv-add:disabled { opacity: .65; cursor: not-allowed; }
.wcas-qv-actions .wcas-qty-minus,
.wcas-qv-actions .wcas-qty-plus { width: 40px; height: 44px; }
.wcas-qv-actions .wcas-qty-input { height: 44px; width: 56px; }
.wcas-qv-actions .wcas-message { flex-basis: 100%; }

/* ── Celular: pantalla completa ── */
@media (max-width: 768px) {
    .wcas-qv { padding: 0; }
    .wcas-qv-box {
        max-width: none; max-height: none;
        width: 100%; height: 100%; height: 100dvh;
        border-radius: 0;
    }
    .wcas-qv-content { flex-direction: column; overflow-y: auto; }
    .wcas-qv-info { flex: none; }
    .wcas-qv-gallery { flex: none; border-right: none; border-bottom: 1px solid var(--wcas-border); }
    .wcas-qv-slide { max-height: 60vh; padding: 16px; }
    .wcas-qv-arrow { display: none !important; }
    .wcas-qv-text { overflow: visible; padding: 18px 16px 12px; }
    .wcas-qv-title { font-size: 18px; }
    .wcas-qv-actions {
        position: sticky; bottom: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 14px rgba(0,0,0,.08);
    }
    .wcas-qv .wcas-qv-close { top: 12px; right: 12px; width: 48px; height: 48px; font-size: 22px; }
    .wcas-qv-content > .wcas-loading,
    .wcas-qv-content > .wcas-error { min-height: 100%; }
}
