/* ============================================================
   Ventova Store — Single Product Page Enhancements
   Modern gallery lightbox, cleaner layout, redesigned tabs
   ============================================================ */


/* ── Gallery Layout ── */

.woocommerce div.product div.images {
    position: relative;
}

/* Main image — clean frame inside card */
.woocommerce div.product div.images .woocommerce-product-gallery__image a {
    display: block;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    border-radius: 0.5em;
    background: var(--vs-border-light);
    border: none;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image a img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    padding: 0.75rem;
    border-radius: 0.5em;
    border: none;
}

/* Expand icon hint on main image */
.woocommerce div.product div.images .woocommerce-product-gallery__image a::after {
    content: "\f065";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: var(--vs-radius-full);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image a:hover::after {
    opacity: 1;
}

/* Hide WC zoom trigger icon */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* Thumbnails — centered strip inside card */
.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
    scrollbar-width: thin;
    scrollbar-color: var(--vs-border) transparent;
}

.woocommerce div.product div.images .flex-control-thumbs::-webkit-scrollbar {
    height: 4px;
}

.woocommerce div.product div.images .flex-control-thumbs::-webkit-scrollbar-thumb {
    background: var(--vs-border);
    border-radius: 2px;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    flex: 0 0 58px;
    width: 58px !important;
    cursor: pointer;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 0.4em;
    border: 2px solid var(--vs-border);
    background: var(--vs-border-light);
    padding: 3px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    aspect-ratio: 1/1;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover {
    border-color: var(--vs-primary-light);
}

.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    border-color: var(--vs-primary);
    box-shadow: 0 0 0 2px rgba(26, 60, 143, 0.12);
}


/* ── Summary — Clean vertical rhythm ── */

.woocommerce div.product div.summary {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Product meta (SKU, category) — below add to cart */
.woocommerce div.product .product_meta {
    order: 10;
    margin-top: var(--vs-space-sm);
    margin-bottom: 0;
    padding-top: var(--vs-space-sm);
    padding-bottom: 0;
    border-top: 1px solid var(--vs-border-light);
    border-bottom: none;
    font-size: 0.78rem;
}

.woocommerce div.product .product_meta > span {
    display: inline;
}

.woocommerce div.product .product_meta > span:not(:last-child)::after {
    content: " · ";
    color: var(--vs-text-light);
}

/* Title */
.woocommerce div.product .product_title {
    font-size: 1.6rem;
    margin-bottom: var(--vs-space-xs);
}

/* Rating row */
.woocommerce div.product .woocommerce-product-rating {
    margin-bottom: var(--vs-space-md);
    padding-bottom: var(--vs-space-md);
    border-bottom: 1px solid var(--vs-border-light);
}

/* Price */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-size: 1.6rem;
    margin-bottom: var(--vs-space-md);
}

/* Short description */
.woocommerce div.product .woocommerce-product-details__short-description {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--vs-text-muted);
    margin-bottom: var(--vs-space-lg);
    padding-bottom: var(--vs-space-lg);
    border-bottom: 1px solid var(--vs-border-light);
}

.woocommerce div.product .woocommerce-product-details__short-description p:last-child {
    margin-bottom: 0;
}

/* Stock badge — inline pill */
.woocommerce div.product .stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: var(--vs-radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: var(--vs-space-md);
}

.woocommerce div.product .stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.woocommerce div.product .in-stock::before {
    background: #10b981;
}

.woocommerce div.product .out-of-stock::before {
    background: #ef4444;
}

/* Add to cart row */
.woocommerce div.product form.cart {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: var(--vs-space-sm);
    margin-bottom: var(--vs-space-md);
    padding: var(--vs-space-lg);
    background: var(--vs-border-light);
    border-radius: var(--vs-radius-lg);
}

/* Variable product: the wrapper div inside form.cart must inherit flex behavior */
.woocommerce div.product form.cart > div {
    width: 100%;
}

/* Variations table takes full row */
.woocommerce div.product form.cart .variations {
    flex-basis: 100%;
    width: 100%;
}

/* Variable product: the add-to-cart row with quantity + button + whatsapp */
.woocommerce div.product .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: var(--vs-space-sm);
    width: 100%;
}

/* Quantity — modern stepper, stays compact */
.woocommerce div.product .quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-md);
    background: var(--vs-bg-white);
    overflow: hidden;
    height: 44px;
    flex-shrink: 0;
}

.woocommerce div.product .quantity .qty {
    width: 52px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--vs-text);
    background: transparent;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.woocommerce div.product .quantity .qty::-webkit-inner-spin-button,
.woocommerce div.product .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to cart button — shares row with quantity */
.woocommerce div.product .single_add_to_cart_button {
    flex: 1;
    height: 44px;
    min-width: 160px;
    padding: 0 1.5rem;
    font-size: 0.95rem;
}

/* ── WhatsApp Order button (OneClick plugin) ── */
.woocommerce div.product form.cart .wa-order-button,
.woocommerce div.product .wa-order-button {
    flex-basis: 100%;
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: #fff !important;
    border: none;
    border-radius: var(--vs-radius-md);
    font-family: var(--vs-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--vs-transition);
    text-decoration: none;
    line-height: 1;
}

.woocommerce div.product form.cart .wa-order-button:hover,
.woocommerce div.product .wa-order-button:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    color: #fff !important;
}

/* WhatsApp button link wrapper — no extra spacing */
.woocommerce div.product form.cart .wa-order-class,
.woocommerce div.product .wa-order-class {
    flex-basis: 100%;
    width: 100%;
    text-decoration: none;
    display: block;
}

/* GDPR WhatsApp button wrapper */
.woocommerce div.product .wa-button-gdpr2 {
    flex-basis: 100%;
    width: 100%;
    display: block;
    margin: 0;
}

.woocommerce div.product .wa-order-gdprchk {
    flex-basis: 100%;
    font-size: 0.78rem;
    color: var(--vs-text-muted);
}

/* Disabled state for GDPR */
.woocommerce div.product .wa-order-button:disabled,
.woocommerce div.product .gdpr_wa_button_input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* WhatsApp button when rendered outside form.cart (under_atc / after_shortdesc) */
.woocommerce div.product div.summary > .wa-order-class,
.woocommerce div.product div.summary > .wa-button-gdpr2 {
    margin-top: calc(-1 * var(--vs-space-md));
    margin-bottom: var(--vs-space-xl);
}


/* ── Tabs — Modern card style ── */

.woocommerce-tabs {
    grid-column: 1 / -1;
    margin-top: var(--vs-space-xl);
}

/* Tab nav — pill style */
.woocommerce-tabs ul.tabs {
    display: flex;
    gap: var(--vs-space-xs);
    padding: var(--vs-space-xs);
    margin: 0 0 0;
    border-bottom: none;
    background: var(--vs-border-light);
    border-radius: var(--vs-radius-lg);
    list-style: none;
}

.woocommerce-tabs ul.tabs::before,
.woocommerce-tabs ul.tabs::after {
    display: none !important;
}

.woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    position: relative;
}

.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
    display: none !important;
}

.woocommerce-tabs ul.tabs li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-text-muted);
    border: none;
    border-bottom: none;
    border-radius: var(--vs-radius-md);
    margin-bottom: 0;
    transition: all 0.15s ease;
    background: transparent;
    white-space: nowrap;
}

.woocommerce-tabs ul.tabs li a:hover {
    color: var(--vs-primary);
    background: var(--vs-bg-white);
}

.woocommerce-tabs ul.tabs li.active a {
    color: var(--vs-primary);
    background: var(--vs-bg-white);
    border-bottom-color: transparent;
    box-shadow: var(--vs-shadow-sm);
    font-weight: 700;
}

/* Tab panels — card */
.woocommerce-tabs .woocommerce-Tabs-panel {
    padding: var(--vs-space-xl);
    background: var(--vs-bg-white);
    border: 1px solid var(--vs-border);
    border-radius: 0 0 var(--vs-radius-lg) var(--vs-radius-lg);
    margin-top: -1px;
}

.woocommerce-tabs .woocommerce-Tabs-panel h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--vs-bg-dark);
    margin-bottom: var(--vs-space-lg);
    padding-bottom: var(--vs-space-sm);
    border-bottom: 2px solid var(--vs-accent);
    display: inline-block;
}

/* Attributes table (Información adicional) */
.woocommerce-tabs .woocommerce-Tabs-panel .woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-tabs .woocommerce-Tabs-panel .woocommerce-product-attributes th {
    background: var(--vs-border-light);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-text);
    text-align: left;
    width: 35%;
    border-bottom: 1px solid var(--vs-border);
}

.woocommerce-tabs .woocommerce-Tabs-panel .woocommerce-product-attributes td {
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--vs-text-muted);
    border-bottom: 1px solid var(--vs-border-light);
}

.woocommerce-tabs .woocommerce-Tabs-panel .woocommerce-product-attributes tr:last-child th,
.woocommerce-tabs .woocommerce-Tabs-panel .woocommerce-product-attributes tr:last-child td {
    border-bottom: none;
}

/* Description content */
.woocommerce-tabs #tab-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--vs-text-muted);
}

.woocommerce-tabs #tab-description p {
    margin-bottom: var(--vs-space-md);
}

.woocommerce-tabs #tab-description ul,
.woocommerce-tabs #tab-description ol {
    padding-left: 1.5rem;
    margin-bottom: var(--vs-space-md);
    list-style: disc;
}

.woocommerce-tabs #tab-description li {
    margin-bottom: var(--vs-space-xs);
}

/* Reviews tab */
.woocommerce-tabs #tab-reviews .woocommerce-Reviews-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--vs-bg-dark);
    margin-bottom: var(--vs-space-lg);
    padding-bottom: var(--vs-space-sm);
    border-bottom: 2px solid var(--vs-accent);
    display: inline-block;
}

/* Review form */
#review_form_wrapper {
    margin-top: var(--vs-space-xl);
    padding-top: var(--vs-space-xl);
    border-top: 1px solid var(--vs-border-light);
}

#review_form .comment-reply-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vs-bg-dark);
    margin-bottom: var(--vs-space-md);
}


/* ── Lightbox Overlay ── */

.vs-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.vs-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.vs-lightbox-overlay.active .vs-lightbox-img {
    transform: scale(1);
}

.vs-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: var(--vs-radius-full);
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 2;
}

.vs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.vs-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--vs-radius-md);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nav arrows */
.vs-lightbox-prev,
.vs-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--vs-radius-full);
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 2;
}

.vs-lightbox-prev { left: 16px; }
.vs-lightbox-next { right: 16px; }

.vs-lightbox-prev:hover,
.vs-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Counter */
.vs-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    font-weight: 500;
}


/* ── Sale badge position on single product ── */

.woocommerce div.product .images .onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}


/* ── Responsive ── */

@media (max-width: 768px) {
    .woocommerce div.product div.images .woocommerce-product-gallery__image a img {
        max-height: 300px;
        padding: 0.5rem;
    }

    .woocommerce div.product div.images {
        padding: 0.75em;
    }

    .woocommerce div.product div.images .flex-control-thumbs li {
        flex: 0 0 50px;
        width: 50px !important;
    }

    .woocommerce div.product div.images .flex-control-thumbs li img {
        width: 50px;
        height: 50px;
    }

    .woocommerce div.product form.cart {
        padding: var(--vs-space-sm);
    }

    .woocommerce div.product .quantity {
        height: 40px;
    }

    .woocommerce div.product .single_add_to_cart_button {
        min-width: auto;
        height: 40px;
        font-size: 0.88rem;
    }

    .woocommerce div.product form.cart .wa-order-button,
    .woocommerce div.product .wa-order-button {
        height: 40px;
        font-size: 0.85rem;
    }

    .woocommerce-tabs ul.tabs {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .woocommerce-tabs ul.tabs::-webkit-scrollbar {
        display: none;
    }

    .woocommerce-tabs .woocommerce-Tabs-panel {
        padding: var(--vs-space-lg);
    }

    .vs-lightbox-prev,
    .vs-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .vs-lightbox-prev { left: 8px; }
    .vs-lightbox-next { right: 8px; }

    .vs-lightbox-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }
}


/* ── WhatsApp Multi-Agent ── */

.vs-wa-agents-wrapper {
    margin-top: var(--vs-space-lg);
    padding-top: var(--vs-space-lg);
    border-top: 1px solid var(--vs-border-light);
}

.vs-wa-agents-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 var(--vs-space-md);
}

.vs-wa-agents-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--vs-space-md);
}

/* Cada tarjeta de agente */
.vs-wa-agent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #25D366 !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    width: 72px;
}

.vs-wa-agent-item:hover {
    transform: translateY(-3px);
}

/* Contenedor del avatar + badge */
.vs-wa-agent-avatar-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

/* Imagen del agente — tamaño fijo */
.vs-wa-agent-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #25D366;
    display: block;
}

/* Fallback icono cuando no hay imagen */
.vs-wa-agent-avatar-fallback {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #25D366;
}

/* Badge de WhatsApp — esquina inferior derecha del avatar */
.vs-wa-agent-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    color: #25D366;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Nombre del agente */
.vs-wa-agent-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #25D366;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

@media (max-width: 768px) {
    .vs-wa-agents-grid {
        gap: var(--vs-space-sm);
    }

    .vs-wa-agent-item {
        width: 62px;
    }

    .vs-wa-agent-avatar,
    .vs-wa-agent-avatar-fallback {
        width: 46px;
        height: 46px;
    }

    .vs-wa-agent-avatar-wrap {
        width: 46px;
        height: 46px;
    }

    .vs-wa-agent-name {
        font-size: 0.68rem;
        max-width: 62px;
    }
}

