/* Single Product Page - Loja Guedez Custom Design */

/* ============================================
   Hide default WooCommerce gallery on single product
   We render our own custom gallery
   ============================================ */
.custom-single-product .woocommerce-product-gallery {
    display: none !important;
}

.custom-single-product .product_title.entry-title {
    display: none !important;
}

/* Hide default sale flash (we have our own) */
.custom-single-product>.onsale {
    display: none !important;
}

/* ============================================
   Product Layout Grid
   ============================================ */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl, 64px);
    align-items: start;
    margin-bottom: var(--spacing-xl, 64px);
}

/* ============================================
   Gallery Section (Thumbnails + Main Image)
   ============================================ */
.product-gallery-custom {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 16px);
    width: 100%;
}

/* Main Product Image */
.gallery-main-image {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1 / 1;
    order: 1;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.gallery-main-image .main-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.main-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main-product-img.fade-out {
    opacity: 0;
}

/* Sale Badge */
.product-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #dc3545;
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
    z-index: 2;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    letter-spacing: 0.5px;
}

/* Thumbnail Row Below Main Image */
.gallery-thumbnails-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    order: 2;
}

.gallery-thumbnails {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    width: 100%;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
    opacity: 0.6;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.gallery-thumb.active {
    border-color: var(--color-navy, #0a192f);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.15));
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail Navigation Arrows */
.thumb-nav {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 50%;
    background: var(--color-white, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light, #64748b);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.thumb-nav:hover {
    border-color: var(--color-navy, #0a192f);
    color: var(--color-navy, #0a192f);
    background: var(--color-bg-light, #f8f9fa);
}

/* ============================================
   Product Summary (Right Side)
   ============================================ */
.product-summary-custom {
    padding-top: 0;
}

/* Title */
.product-title-custom {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-navy, #0a192f);
    margin: 0 0 var(--spacing-md, 16px);
    line-height: 1.3;
}

/* Short Description */
.product-short-desc {
    color: var(--color-text, #334155);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: var(--spacing-lg, 32px);
}

.product-short-desc p {
    margin-bottom: 8px;
}

.product-short-desc strong {
    color: var(--color-navy, #0a192f);
}

/* ============================================
   Price Section (product-price-custom)
   ============================================ */
.product-price-custom {
    margin-bottom: var(--spacing-md, 16px);
}

/* Override WooCommerce default price styling */
.product-price-custom .price,
.woocommerce-variation-price .price {
    margin-bottom: var(--spacing-lg, 32px);
}

/* Base Price Wrapper structure from functions.php */
.product-price-custom .price .price-with-pix,
.woocommerce-variation-price .price .price-with-pix {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

/* Original price -> Gray, crossed out, moved above */
.product-price-custom .price .price-with-pix .pix-original-price,
.woocommerce-variation-price .price .price-with-pix .pix-original-price {
    width: 100%;
    order: -1;
    /* Move to top in flex container */
    margin-bottom: -4px;
}

.product-price-custom .price .price-with-pix .pix-original-price del,
.product-price-custom .price .price-with-pix .pix-original-price .woocommerce-Price-amount,
.woocommerce-variation-price .price .price-with-pix .pix-original-price del,
.woocommerce-variation-price .price .price-with-pix .pix-original-price .woocommerce-Price-amount {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.1rem !important;
    color: var(--color-text-light, #94a3b8) !important;
    font-weight: 500;
    text-decoration: line-through;
}

/* Sale Price -> Medium weight, slightly smaller */
.product-price-custom .price .price-with-pix .pix-sale-price,
.product-price-custom .price .price-with-pix .pix-sale-price .woocommerce-Price-amount,
.woocommerce-variation-price .price .price-with-pix .pix-sale-price,
.woocommerce-variation-price .price .price-with-pix .pix-sale-price .woocommerce-Price-amount {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.8rem !important;
    /* Reduced from 2.2rem */
    color: var(--color-navy, #0a192f) !important;
    font-weight: 700;
    /* Reduced from 800 */
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

/* 'no Pix' Label */
.product-price-custom .price .price-with-pix .pix-label,
.woocommerce-variation-price .price .price-with-pix .pix-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text, #334155);
}

/* Discount Badge -> Orange */
.product-price-custom .price .price-with-pix .pix-discount,
.woocommerce-variation-price .price .price-with-pix .pix-discount {
    background-color: var(--color-orange, #eb8534);
    color: #fff;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transform: translateY(-2px);
}

/* Hide the default price for simple products and the base price range for variable products */
.product-add-to-cart-area>.price,
.product-add-to-cart-area p.price,
.price-with-pix+.woocommerce-Price-amount {
    display: none !important;
}

/* Divider */
.product-divider {
    border: none;
    border-top: 1px solid var(--color-border, #e2e8f0);
    margin: var(--spacing-md, 16px) 0;
}

/* ============================================
   Variations - Transform dropdown into buttons
   ============================================ */
.product-add-to-cart-area .variations {
    margin-bottom: var(--spacing-md, 16px);
    border: none;
    width: 100%;
}

.product-add-to-cart-area .variations tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-add-to-cart-area .variations tr {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.product-add-to-cart-area .variations td,
.product-add-to-cart-area .variations th {
    border: none;
    padding: 0;
    display: block;
    width: 100%;
}

.product-add-to-cart-area .variations .label {
    padding: 0;
    white-space: nowrap;
    text-align: left;
}

.product-add-to-cart-area .variations .label label {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    color: var(--color-text, #334155);
    font-weight: 500;
}

.product-add-to-cart-area .variations .label label::after {
    content: ':';
}

.product-add-to-cart-area .variations .value {
    width: 100%;
}

/* Variation Buttons (JS replaces dropdown) */
.variation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.variation-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 16px;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
    background: var(--color-white, #fff);
    color: var(--color-text, #334155);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.variation-btn:hover {
    border-color: var(--color-navy, #0a192f);
    color: var(--color-navy, #0a192f);
}

.variation-btn.selected {
    border-color: var(--color-navy, #0a192f);
    background-color: var(--color-navy, #0a192f);
    color: var(--color-white, #fff);
    font-weight: 700;
}

/* Hide original select when buttons are present */
.product-add-to-cart-area .variations select.has-buttons {
    display: none !important;
}

/* Reset/Clear link - hidden per user request */
.product-add-to-cart-area .reset_variations {
    display: none !important;
}

/* ============================================
   Custom Quantity + Add to Cart Row
   ============================================ */
.product-add-to-cart-area .single_add_to_cart_button {
    background-color: var(--color-orange, #f26522) !important;
    color: var(--color-white, #fff) !important;
    border-radius: 8px !important;
    padding: 14px 36px !important;
    font-family: var(--font-heading, 'Montserrat', sans-serif) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    line-height: 1.4 !important;
}

.product-add-to-cart-area .single_add_to_cart_button:hover {
    background-color: var(--color-orange-hover, #d95316) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Quantity Wrapper */
.product-add-to-cart-area .quantity-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    height: 48px;
    margin-right: 12px;
}

.product-add-to-cart-area .quantity-wrapper .qty-btn {
    width: 42px;
    height: 100%;
    border: none;
    background: var(--color-white, #fff);
    color: var(--color-text, #334155);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.product-add-to-cart-area .quantity-wrapper .qty-btn:hover {
    background-color: var(--color-bg-light, #f8f9fa);
    color: var(--color-navy, #0a192f);
}

.product-add-to-cart-area .quantity-wrapper .qty-input {
    width: 52px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--color-border, #e2e8f0);
    border-right: 1px solid var(--color-border, #e2e8f0);
    text-align: center;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-navy, #0a192f);
    background: var(--color-white, #fff);
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-add-to-cart-area .quantity-wrapper .qty-input::-webkit-outer-spin-button,
.product-add-to-cart-area .quantity-wrapper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Default quantity field override */
.product-add-to-cart-area .quantity {
    display: none !important;
    /* JS replaces this */
}

/* Cart + Qty row */
.product-add-to-cart-area form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.product-add-to-cart-area form.cart .variations {
    width: 100%;
    flex-basis: 100%;
}

.product-add-to-cart-area .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   Payment Area
   ============================================ */
.product-payment-area {
    margin-bottom: var(--spacing-md, 16px);
}

.product-payment-area:empty {
    display: none;
}

/* ============================================
   Share Section
   ============================================ */
.product-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--spacing-md, 16px);
}

.share-label {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-navy, #0a192f);
}

.share-icons {
    display: flex;
    gap: 8px;
}

.share-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.share-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-facebook {
    background-color: #1877f2;
}

.share-twitter {
    background-color: #0f1419;
}

.share-pinterest {
    background-color: #e60023;
}

.share-email {
    background-color: #64748b;
}

.share-whatsapp {
    background-color: #25d366;
}

/* ============================================
   Product Meta
   ============================================ */
.product-meta-custom {
    font-size: 0.85rem;
    color: var(--color-text-light, #64748b);
    margin-top: var(--spacing-md, 16px);
}

.product-meta-custom .product_meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-meta-custom .product_meta>span {
    display: block;
}

.product-meta-custom .product_meta a {
    color: var(--color-orange, #f26522);
    font-weight: 500;
}

.product-meta-custom .product_meta a:hover {
    color: #d4af37;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 968px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg, 32px);
    }

    .gallery-thumb {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 580px) {

    .thumb-nav-left,
    .thumb-nav-right {
        display: none;
    }

    .gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .product-title-custom {
        font-size: 1.4rem;
    }

    .product-price-custom .price {
        font-size: 1.3rem;
    }
}

/* ============================================
   Zoom: Hover-to-zoom effect
   ============================================ */

/* Zoom cursor on main image */
.gallery-main-image .main-image-link {
    cursor: crosshair;
}

.gallery-main-image.zooming .main-product-img {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Zoom overlay */
.product-zoom-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background-repeat: no-repeat;
    background-color: #fff;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.product-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* "Passe o mouse para zoom" hint */
.gallery-main-image::after {
    content: '🔍 Passe o mouse para zoom';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.gallery-main-image:hover::after {
    opacity: 1;
}

.gallery-main-image.zooming::after {
    opacity: 0;
}

/* Hide zoom hint on mobile/touch */
@media (hover: none) {
    .gallery-main-image::after {
        display: none;
    }
}