/* ========================================
   Custom CSS - Hide Variations Form in Product Boxes
   ======================================== */

/* ========================================
   Hide Add to Cart Buttons on Home and Category Pages
   ======================================== */

/* Hide all add to cart buttons on home page and category pages */
.home .products .product a.button.primary,
.home .products .product a.button.product_type_variable,
.home .products .product a.button.add_to_cart_button,
.home .products .product a.button.rtwpvs_add_to_cart,
.home .products .product a.button.rtwpvs_ajax_add_to_cart,
.home .products .product .product-cart-form a.button,
.home .products .product .content-wrapper .product-cart-form a.button,

/* Hide on category pages */
.product-category .products .product a.button.primary,
.product-category .products .product a.button.product_type_variable,
.product-category .products .product a.button.add_to_cart_button,
.product-category .products .product a.button.rtwpvs_add_to_cart,
.product-category .products .product a.button.rtwpvs_ajax_add_to_cart,
.product-category .products .product .product-cart-form a.button,
.product-category .products .product .content-wrapper .product-cart-form a.button,

/* Hide on shop page */
.woocommerce-shop .products .product a.button.primary,
.woocommerce-shop .products .product a.button.product_type_variable,
.woocommerce-shop .products .product a.button.add_to_cart_button,
.woocommerce-shop .products .product a.button.rtwpvs_add_to_cart,
.woocommerce-shop .products .product a.button.rtwpvs_ajax_add_to_cart,
.woocommerce-shop .products .product .product-cart-form a.button,
.woocommerce-shop .products .product .content-wrapper .product-cart-form a.button,

/* Hide on archive pages */
.archive .products .product a.button.primary,
.archive .products .product a.button.product_type_variable,
.archive .products .product a.button.add_to_cart_button,
.archive .products .product a.button.rtwpvs_add_to_cart,
.archive .products .product a.button.rtwpvs_ajax_add_to_cart,
.archive .products .product .product-cart-form a.button,
.archive .products .product .content-wrapper .product-cart-form a.button,

/* Hide on blog pages */
.blog .products .product a.button.primary,
.blog .products .product a.button.product_type_variable,
.blog .products .product a.button.add_to_cart_button,
.blog .products .product a.button.rtwpvs_add_to_cart,
.blog .products .product a.button.rtwpvs_ajax_add_to_cart,
.blog .products .product .product-cart-form a.button,
.blog .products .product .content-wrapper .product-cart-form a.button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Keep product cart form visible but hide only buttons */
/* Price and other elements in product-cart-form will remain visible */

/* Ensure price is visible on home and category pages */
.home .products .product .price,
.home .products .product .product-cart-form .price,
.home .products .product .content-wrapper .price,
.product-category .products .product .price,
.product-category .products .product .product-cart-form .price,
.product-category .products .product .content-wrapper .price,
.woocommerce-shop .products .product .price,
.woocommerce-shop .products .product .product-cart-form .price,
.woocommerce-shop .products .product .content-wrapper .price,
.archive .products .product .price,
.archive .products .product .product-cart-form .price,
.archive .products .product .content-wrapper .price,
.blog .products .product .price,
.blog .products .product .product-cart-form .price,
.blog .products .product .content-wrapper .price {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    
    /* Auto-scale font size to fit container */
    font-size: clamp(0.7rem, 2vw, 1rem) !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    word-break: keep-all !important;
}

/* Handle price ranges and multiple price elements */
.home .products .product .price .woocommerce-Price-amount,
.home .products .product .price del,
.home .products .product .price ins,
.product-category .products .product .price .woocommerce-Price-amount,
.product-category .products .product .price del,
.product-category .products .product .price ins,
.woocommerce-shop .products .product .price .woocommerce-Price-amount,
.woocommerce-shop .products .product .price del,
.woocommerce-shop .products .product .price ins,
.archive .products .product .price .woocommerce-Price-amount,
.archive .products .product .price del,
.archive .products .product .price ins,
.blog .products .product .price .woocommerce-Price-amount,
.blog .products .product .price del,
.blog .products .product .price ins {
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: nowrap !important;
    display: inline !important;
}

/* Hide all variation-related elements in product boxes/loops */
.products .product.product-type-variable form.variations_form,
.products .product.product-type-variable table.variations,
.products .product.product-type-variable .single_variation_wrap,
.products .product.product-type-variable .reset_variations_alert,
.products .product.product-type-variable .woocommerce-variation,
.products .product.product-type-variable .woocommerce-variation-add-to-cart {
    display: none !important;
}


/* Ensure the main add to cart button is visible */
.products .product.product-type-variable .product-cart-form {
    display: block !important;
}

.products .product.product-type-variable .product-cart-form a.button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Fix text alignment for add to cart buttons */
.products .product.product-type-variable a.button.primary,
.products .product.product-type-variable a.button.product_type_variable,
.products .product.product-type-variable a.button.add_to_cart_button,
.products .product.product-type-variable a.button.rtwpvs_add_to_cart,
.products .product.product-type-variable a.button.rtwpvs_ajax_add_to_cart {
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

/* Specific fix for the exact button class combination */
.products .product.product-type-variable a.primary.button.product_type_variable.add_to_cart_button.rtwpvs_add_to_cart.rtwpvs_ajax_add_to_cart {
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
    padding: 10px 15px !important;
}

/* Fix for button content alignment */
.products .product.product-type-variable a.button i {
    margin-left: 5px !important;
    vertical-align: middle !important;
}

/* Hide any variation swatches in product boxes */
.products .product.product-type-variable .rtwpvs-terms-wrapper,
.products .product.product-type-variable .rtwpvs-variation-terms-wrapper {
    display: none !important;
}

/* Ensure product title and price are still visible */
.products .product.product-type-variable .product-title,
.products .product.product-type-variable .price {
    display: block !important;
}

/* Hide any variation-related JavaScript elements */
.products .product.product-type-variable [data-product_variations] {
    display: none !important;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .products .product.product-type-variable form.variations_form,
    .products .product.product-type-variable table.variations,
    .products .product.product-type-variable .single_variation_wrap {
        display: none !important;
    }
    
    /* Hide add to cart buttons on mobile for home and category pages */
    .home .products .product a.button.primary,
    .home .products .product a.button.product_type_variable,
    .home .products .product a.button.add_to_cart_button,
    .home .products .product a.button.rtwpvs_add_to_cart,
    .home .products .product a.button.rtwpvs_ajax_add_to_cart,
    .home .products .product .product-cart-form a.button,
    .home .products .product .content-wrapper .product-cart-form a.button,
    
    .product-category .products .product a.button.primary,
    .product-category .products .product a.button.product_type_variable,
    .product-category .products .product a.button.add_to_cart_button,
    .product-category .products .product a.button.rtwpvs_add_to_cart,
    .product-category .products .product a.button.rtwpvs_ajax_add_to_cart,
    .product-category .products .product .product-cart-form a.button,
    .product-category .products .product .content-wrapper .product-cart-form a.button,
    
    .woocommerce-shop .products .product a.button.primary,
    .woocommerce-shop .products .product a.button.product_type_variable,
    .woocommerce-shop .products .product a.button.add_to_cart_button,
    .woocommerce-shop .products .product a.button.rtwpvs_add_to_cart,
    .woocommerce-shop .products .product a.button.rtwpvs_ajax_add_to_cart,
    .woocommerce-shop .products .product .product-cart-form a.button,
    .woocommerce-shop .products .product .content-wrapper .product-cart-form a.button,
    
    .archive .products .product a.button.primary,
    .archive .products .product a.button.product_type_variable,
    .archive .products .product a.button.add_to_cart_button,
    .archive .products .product a.button.rtwpvs_add_to_cart,
    .archive .products .product a.button.rtwpvs_ajax_add_to_cart,
    .archive .products .product .product-cart-form a.button,
    .archive .products .product .content-wrapper .product-cart-form a.button,
    
    .blog .products .product a.button.primary,
    .blog .products .product a.button.product_type_variable,
    .blog .products .product a.button.add_to_cart_button,
    .blog .products .product a.button.rtwpvs_add_to_cart,
    .blog .products .product a.button.rtwpvs_ajax_add_to_cart,
    .blog .products .product .product-cart-form a.button,
    .blog .products .product .content-wrapper .product-cart-form a.button {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Keep product cart form visible on mobile - only buttons are hidden */
    /* Price and other elements in product-cart-form will remain visible */
    
    /* Ensure price is visible on mobile for home and category pages */
    .home .products .product .price,
    .home .products .product .product-cart-form .price,
    .home .products .product .content-wrapper .price,
    .product-category .products .product .price,
    .product-category .products .product .product-cart-form .price,
    .product-category .products .product .content-wrapper .price,
    .woocommerce-shop .products .product .price,
    .woocommerce-shop .products .product .product-cart-form .price,
    .woocommerce-shop .products .product .content-wrapper .price,
    .archive .products .product .price,
    .archive .products .product .product-cart-form .price,
    .archive .products .product .content-wrapper .price,
    .blog .products .product .price,
    .blog .products .product .product-cart-form .price,
    .blog .products .product .content-wrapper .price {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        
        /* Auto-scale font size to fit container on mobile */
        font-size: clamp(0.9rem, 4vw, 1.3rem) !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        word-break: keep-all !important;
    }
}

/* Additional mobile-specific font size adjustments */
@media (max-width: 480px) {
    .home .products .product .price,
    .home .products .product .product-cart-form .price,
    .home .products .product .content-wrapper .price,
    .product-category .products .product .price,
    .product-category .products .product .product-cart-form .price,
    .product-category .products .product .content-wrapper .price,
    .woocommerce-shop .products .product .price,
    .woocommerce-shop .products .product .product-cart-form .price,
    .woocommerce-shop .products .product .content-wrapper .price,
    .archive .products .product .price,
    .archive .products .product .product-cart-form .price,
    .archive .products .product .content-wrapper .price,
    .blog .products .product .price,
    .blog .products .product .product-cart-form .price,
    .blog .products .product .content-wrapper .price {
        line-height: 1.3 !important;
    }
}

/* Desktop-specific font size adjustments */
@media (min-width: 769px) {
    .home .products .product .price,
    .home .products .product .product-cart-form .price,
    .home .products .product .content-wrapper .price,
    .product-category .products .product .price,
    .product-category .products .product .product-cart-form .price,
    .product-category .products .product .content-wrapper .price,
    .woocommerce-shop .products .product .price,
    .woocommerce-shop .products .product .product-cart-form .price,
    .woocommerce-shop .products .product .content-wrapper .price,
    .archive .products .product .price,
    .archive .products .product .product-cart-form .price,
    .archive .products .product .content-wrapper .price,
    .blog .products .product .price,
    .blog .products .product .product-cart-form .price,
    .blog .products .product .content-wrapper .price {
        font-size: clamp(1rem, 1.8vw, 0.9rem) !important;
        line-height: 1.1 !important;
    }
}

/* ========================================
   Custom Single Product Layout
   ======================================== */

/* Single product wrapper styling */
.single-product-wrapper.custom-product-layout {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

/* Product gallery column */
.product-gallery-column {
    padding-right: 30px;
}

.product-gallery-wrapper {
    position: relative;
}

/* Main product image styling */
.product-gallery-wrapper .woocommerce-product-gallery {
    margin-bottom: 20px;
}

.product-gallery-wrapper .woocommerce-product-gallery__image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-gallery-wrapper .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-gallery-wrapper .woocommerce-product-gallery__image:hover img {
    transform: scale(1.02);
}

/* Thumbnail gallery styling */
.product-gallery-wrapper .woocommerce-product-gallery__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.product-gallery-wrapper .woocommerce-product-gallery__thumbs .woocommerce-product-gallery__image {
    flex: 1;
    max-width: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.product-gallery-wrapper .woocommerce-product-gallery__thumbs .woocommerce-product-gallery__image:hover,
.product-gallery-wrapper .woocommerce-product-gallery__thumbs .woocommerce-product-gallery__image.active {
    border-color: #007cba;
}

/* Product info column */
.product-info-column {
    padding-left: 30px;
}

.product-info-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Product title styling */
.product-info-wrapper .product_title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.3;
}

/* Product description styling */
.product-info-wrapper .woocommerce-product-details__short-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Price styling */
.product-info-wrapper .price {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.product-info-wrapper .price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

/* Add to cart button styling */
.product-info-wrapper .single_add_to_cart_button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    width: 100%;
    max-width: 300px;
}

.product-info-wrapper .single_add_to_cart_button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

/* Delivery info styling */
.product-info-wrapper .delivery-info {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .single-product-wrapper.custom-product-layout {
        padding: 20px;
        margin: 10px 0;
    }
    
    .product-gallery-column,
    .product-info-column {
        padding: 0;
        margin-bottom: 30px;
    }
    
    .product-info-wrapper .product_title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .product-info-wrapper .price {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .product-info-wrapper .single_add_to_cart_button {
        padding: 12px 30px;
        font-size: 1rem;
        max-width: 100%;
    }
}

/* Center align product price */
.single-product-wrapper .product-detail .price,
.woocommerce div.product .price,
.product .price,
.cell.product-detail .price {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
}
