/* ============================================
   OPTIMIZED WOOCOMMERCE SINGLE PRODUCT STYLING
   ============================================ */

/* ============================================
   BASE CONTAINER & LAYOUT
   ============================================ */

.ast-separate-container.single-product div.ast-article-single {
    background: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 20px;
}

.ast-separate-container.single-product li.ast-article-single {
    background: #F2F2F2 !important;
    padding: 30px 0px !important;
}

.single-product .ast-woocommerce-container {
    padding: 0px;
    margin: 60px auto;
    max-width: 1200px;
    animation: fadeInUp 0.6s ease-out;
}

/* Product Layout - Two Column Grid */
.single-product #product-18865 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* ============================================
   PRODUCT GALLERY - FIXED FOR SINGLE & MULTIPLE IMAGES
   ============================================ */

.woocommerce-product-gallery {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

/* Fix for flexslider viewport constraint when multiple images exist */
.woocommerce-product-gallery .flex-viewport {
    height: auto !important;
    min-height: 400px !important;
    max-height: 600px !important;
    overflow: visible !important;
    width: 100% !important;
}

.woocommerce-product-gallery__wrapper {
    width: 100% !important;
    max-width: 600px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
    transition: none !important;
    height: auto !important;
}

/* Gallery images - handle both single and multiple image cases */
.woocommerce-product-gallery__image {
    width: 100% !important;
    height: auto !important;
    max-height: 600px !important;
    min-height: 400px !important;
    display: flex !important; /* Show by default for single images */
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #F5F1E8 !important;
    flex-shrink: 0 !important;
    margin-right: 0 !important;
    float: none !important;
}

/* For multiple images (flexslider case), hide non-active images */
.flex-viewport .woocommerce-product-gallery__image {
    display: none !important;
}

/* Show only the active image in flexslider */
.flex-viewport .woocommerce-product-gallery__image.flex-active-slide {
    display: flex !important;
}

.woocommerce-product-gallery__image img {
    border-radius: 12px !important;
    width: 100% !important;
    height: auto !important;
    max-height: 600px !important;
    min-height: 400px !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.3s ease !important;
}

/* Gallery trigger (zoom button) */
.woocommerce-product-gallery__trigger {
    position: absolute !important;
    top: 15px !important;
    right: 25px !important;
    z-index: 10 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.woocommerce-product-gallery__trigger:hover {
    background: #06BCC1 !important;
    transform: scale(1.1) !important;
}

/* Thumbnail navigation - positioned below main image */
.flex-control-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    margin-top: 15px !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    order: 2 !important; /* Ensure thumbnails appear after main image */
}

.flex-control-nav li {
    margin: 0 !important;
    cursor: pointer !important;
}

.flex-control-nav li img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    opacity: 0.7 !important;
}

.flex-control-nav li img:hover,
.flex-control-nav li img.flex-active {
    border-color: #06BCC1 !important;
    opacity: 1 !important;
    transform: scale(1.05) !important;
}

/* ============================================
   PRODUCT SUMMARY SECTION
   ============================================ */

.summary.entry-summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

/* Breadcrumb Styling */
.woocommerce-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.woocommerce-breadcrumb a {
    color: #06BCC1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.woocommerce-breadcrumb a:hover {
    color: #12263A;
}

/* Category Links */
.single-product-category {
    display: flex !important;
    flex-wrap: wrap !important;
}

.single-product-category a {
    background: #B8D4C7;
    color: #12263A;
    padding: 4px 12px;
    margin: 4px 8px 4px 0;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.single-product-category a:hover {
    background: #06BCC1;
    color: white;
}

/* Product Title */
.product_title {
    font-size: 28px;
    font-weight: 600;
    color: #12263A;
    margin: 20px 0;
    line-height: 1.3;
}

/* Price Styling */
.price {
    font-size: 24px;
    font-weight: 700;
    color: #06BCC1;
    margin: 20px 0;
}

.price .woocommerce-Price-amount {
    color: #06BCC1;
}

/* ============================================
   PRODUCT VARIATIONS & FORM
   ============================================ */

.variations_form {
    margin: 30px 0;
}

/* Variation Swatches */
.cfvsw-swatches-option {
    background: white !important;
    border: 2px solid #B8D4C7 !important;
    color: #12263A !important;
    margin: 5px !important;
    padding: 8px 15px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.cfvsw-swatches-option:hover,
.cfvsw-swatches-option.cfvsw-selected-swatch {
    background: #06BCC1 !important;
    border-color: #06BCC1 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 188, 193, 0.3);
}

.woocommerce-variation.single_variation {
    padding: 0px;
    margin: 0px 0px 50px 0px;
}

/* ============================================
   ADD TO CART SECTION (INTEGRATED DESIGN)
   ============================================ */

/* Integrated Quantity + Add to Cart Container - Variable Products */
.woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: center !important;
    background: linear-gradient(135deg, #06BCC1, #B8D4C7) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(6, 188, 193, 0.3) !important;
    transition: all 0.3s ease !important;
}

.woocommerce-variation-add-to-cart:hover {
    background: linear-gradient(135deg, #12263A, #06BCC1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(6, 188, 193, 0.4) !important;
}

/* Integrated Quantity + Add to Cart Container - Simple Products */
.summary .cart:not(.variations_form) {
    display: flex !important;
    align-items: center !important;
    background: linear-gradient(135deg, #06BCC1, #B8D4C7) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(6, 188, 193, 0.3) !important;
    transition: all 0.3s ease !important;
}

.summary .cart:not(.variations_form):hover {
    background: linear-gradient(135deg, #12263A, #06BCC1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(6, 188, 193, 0.4) !important;
}

/* Add to Cart Button - Left Side (Both Variable & Simple Products) */
.woocommerce-variation-add-to-cart .single_add_to_cart_button,
.summary .cart:not(.variations_form) .single_add_to_cart_button {
    background: transparent !important;
    color: white !important;
    border: none !important;
    padding: 15px 25px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    flex: 1 !important;
    min-height: 50px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    order: 1 !important;
    line-height: 1.5 !important;
}

/* Quantity Controls - Right Side (Both Variable & Simple Products) */
.woocommerce-variation-add-to-cart .quantity.buttons_added,
.summary .cart:not(.variations_form) .quantity.buttons_added {
    display: flex !important;
    align-items: center !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    order: 2 !important;
}

.woocommerce-variation-add-to-cart .quantity .minus,
.woocommerce-variation-add-to-cart .quantity .plus,
.summary .cart:not(.variations_form) .quantity .minus,
.summary .cart:not(.variations_form) .quantity .plus {
    background: transparent !important;
    color: white !important;
    border: none !important;
    width: 45px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}

.woocommerce-variation-add-to-cart .quantity .minus:hover,
.woocommerce-variation-add-to-cart .quantity .plus:hover,
.summary .cart:not(.variations_form) .quantity .minus:hover,
.summary .cart:not(.variations_form) .quantity .plus:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.woocommerce-variation-add-to-cart .quantity .qty,
.summary .cart:not(.variations_form) .quantity .qty {
    border: none !important;
    text-align: center !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 16px !important;
}

/* ============================================
   PRODUCT META & STOCK INFO
   ============================================ */

.product_meta {
    display: none !important;
}

.product_meta span {
    display: block;
    margin: 8px 0;
    color: #12263A;
}

.product_meta a {
    color: #06BCC1;
    text-decoration: none;
}

.product_meta a:hover {
    color: #12263A;
}

/* Stock Information */
.ast-stock-detail {
    color: #12263A;
    margin: 10px 0;
}

.stock.in-stock {
    color: #06BCC1;
    font-weight: 600;
}

/* Express Checkout Buttons - Fix Visibility Issues */
#wc-stripe-express-checkout-element {
    margin: 20px 0 !important;
    min-height: 60px !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
}

#wc-stripe-express-checkout-element .StripeElement {
    min-height: 48px !important;
    height: auto !important;
    display: block !important;
}

#wc-stripe-express-checkout-element .__PrivateStripeElement {
    min-height: 48px !important;
    height: auto !important;
}

#wc-stripe-express-checkout-element iframe {
    min-height: 48px !important;
    height: 48px !important;
    max-height: none !important;
}

/* ============================================
   PRODUCT TABS SECTION
   ============================================ */

.woocommerce-tabs {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.wc-tabs {
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
}

.wc-tabs li a {
    border: none;
    color: #12263A !important;
}

.wc-tabs li.active a,
.wc-tabs li a:hover {
    color: #06BCC1 !important;
    text-decoration: underline !important;
    text-underline-offset: 10px !important;
    text-decoration-thickness: 2px !important;
}

.woocommerce-js div.product .woocommerce-tabs ul.tabs li.active::before,
.woocommerce-js div.product .woocommerce-tabs ul.tabs li::after,
.woocommerce-js div.product .woocommerce-tabs ul.tabs.tabs::before {
    display: none !important;
}

/* ============================================
   RELATED PRODUCTS SECTION
   ============================================ */

.related.products {
    margin: 40px 0;
}

.related.products h2 {
    font-size: 28px;
    color: #12263A;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Related Products Grid */
.related .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 0;
    list-style: none;
}

/* Individual Product Cards */
.related .products li {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.related .products li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.related .products li:nth-child(1) { animation-delay: 0.1s; }
.related .products li:nth-child(2) { animation-delay: 0.2s; }
.related .products li:nth-child(3) { animation-delay: 0.3s; }
.related .products li:nth-child(4) { animation-delay: 0.4s; }

/* Product Image Container */
.astra-shop-thumbnail-wrap {
    background: #F2F2F2;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    overflow: hidden;
}

.astra-shop-thumbnail-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.related .products li:hover .astra-shop-thumbnail-wrap img {
    transform: scale(1.05);
}

/* Product Summary */
.astra-shop-summary-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Product Title */
.woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 600;
    color: #12263A;
    margin: 10px 0;
    line-height: 1.4;
    text-align: center;
}

.ast-loop-product__link {
    text-decoration: none;
}

.ast-loop-product__link:hover .woocommerce-loop-product__title {
    color: #06BCC1;
}

/* Related Products Price */
.related .products .price {
    font-size: 18px;
    font-weight: 700;
    color: #06BCC1;
    text-align: center;
    margin: 15px 0;
}

/* Related Products Buttons */
.related .products .button {
    background: linear-gradient(135deg, #06BCC1, #B8D4C7) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    margin-top: auto;
}

.related .products .button:hover {
    background: linear-gradient(135deg, #12263A, #06BCC1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(6, 188, 193, 0.3) !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

.screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

.woocommerce-variation-add-to-cart .single_add_to_cart_button:focus,
.summary .cart:not(.variations_form) .single_add_to_cart_button:focus,
.cfvsw-swatches-option:focus,
.woocommerce-variation-add-to-cart .quantity .minus:focus,
.woocommerce-variation-add-to-cart .quantity .plus:focus,
.summary .cart:not(.variations_form) .quantity .minus:focus,
.summary .cart:not(.variations_form) .quantity .plus:focus {
    outline: 2px solid #06BCC1;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet Landscape & Desktop */
@media (min-width: 700px) {
    .woocommerce-product-gallery {
        width: 50% !important;
        padding: 0px 0px;
    }
    
    .summary.entry-summary {
        width: 50% !important;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .single-product #product-18865 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .ast-woocommerce-container {
        padding: 20px;
        margin: 10px;
    }
    
    .related .products {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    /* Ensure gallery maintains proper size on tablet */
    .woocommerce-product-gallery__image {
        min-height: 300px !important;
        max-height: 500px !important;
    }
    
    .woocommerce-product-gallery__image img {
        min-height: 300px !important;
        max-height: 500px !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ast-woocommerce-container {
        padding: 15px;
        margin: 5px;
    }
    
    .summary.entry-summary {
        padding: 20px;
    }
    
    .product_title {
        font-size: 24px;
    }
    
    .price {
        font-size: 20px;
    }
    
    .related .products {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .related .products li {
        padding: 15px;
    }
    
    .astra-shop-thumbnail-wrap {
        height: 180px;
    }
    
    .woocommerce-tabs {
        padding: 20px;
    }
    
    .wc-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .wc-tabs li a {
        border-radius: 8px;
        text-align: center;
    }
    
    /* Mobile gallery adjustments */
    .woocommerce-product-gallery__image {
        min-height: 250px !important;
        max-height: 400px !important;
    }
    
    .woocommerce-product-gallery__image img {
        min-height: 250px !important;
        max-height: 400px !important;
    }
    
    .flex-control-nav li img {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .variations_form {
        padding: 15px;
    }
    
    .woocommerce-variation-add-to-cart,
    .summary .cart:not(.variations_form) {
        width: 100% !important;
    }
    
    .woocommerce-variation-add-to-cart .quantity .minus,
    .woocommerce-variation-add-to-cart .quantity .plus,
    .summary .cart:not(.variations_form) .quantity .minus,
    .summary .cart:not(.variations_form) .quantity .plus {
        width: 40px !important;
        height: 45px !important;
    }
    
    .woocommerce-variation-add-to-cart .quantity .qty,
    .summary .cart:not(.variations_form) .quantity .qty {
        width: 45px !important;
        height: 45px !important;
    }
    
    .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    .summary .cart:not(.variations_form) .single_add_to_cart_button {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    /* Small mobile gallery */
    .woocommerce-product-gallery__image {
        min-height: 200px !important;
        max-height: 350px !important;
    }
    
    .woocommerce-product-gallery__image img {
        min-height: 200px !important;
        max-height: 350px !important;
    }
}

/* Hide price for variable products (products with variations) 
.ast-separate-container.single-product div.ast-article-single.product-type-variable .summary > .price {
    display: none !important;
}
*/

/* Add bottom padding for simple products (products without variations) */
.ast-separate-container.single-product div.ast-article-single.product-type-simple .summary .price {
    margin-bottom: 40px;
}

.reset_variations{
    display: none !important;
}