/*
Theme Name:   xstore-child
Theme URI:    https://xstore.8theme.com
Description:  XStore is a multi-purpose theme that offers the ultimate WordPress and WooCommerce synergy, providing a comprehensive, all-in-one solution.
Author:       8theme
Author URI:   https://www.8theme.com
Template:     xstore
Version:      1.0
Text Domain:  xstore-child
Tags: e-commerce, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-menu, custom-logo, featured-images, full-width-template, threaded-comments, accessibility-ready, rtl-language-support, footer-widgets, sticky-post, theme-options, translation-ready, ecommerce, woocommerce, shop, elementor, business, corporate, blog, news, light, dark
*/

/* Product Accordions Styles */
.product-accordions {
    margin-top: 30px;
    border-top: 1px solid #e1e1e1;
}

.accordion-item {
    border-bottom: 1px solid #e1e1e1;
}

.accordion-title {
    font-size: 14px !important;
    padding: 15px 0;
    cursor: pointer;
    position: relative;
    margin: 0;
}

.accordion-title::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid #333;
    border-right: 2px solid #333;
    transform: translateY(-75%) rotate(45deg);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-title::after {
    transform: translateY(-25%) rotate(-135deg);
}

.accordion-content {
    padding: 0 0 15px 0;
    font-size: 13px !important;
    line-height: 1.6;
}

/* Uniform Product Image Sizes */
.content-product .product-content-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5; 
}

.content-product .product-content-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.content-product:hover .product-content-image img {
    transform: scale(1.05);
}

/* --- Single Product Page Styles --- */

/* Increase size of attribute swatches (e.g., Size) */
.variations_form .st-swatch-preview .type-label .st-custom-attribute {
    min-width: 45px !important;
    height: 45px !important;
    line-height: 45px !important;
    font-size: 14px !important;
}

/* Reposition Size Guide Link */
.variations_form .variations .label > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.bouldergain-size-guide-trigger {
    font-size: 14px;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
}

/* --- New Size Guide Modal Styles --- */
body.bouldergain-modal-open {
    overflow: hidden;
}

.bouldergain-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: none;
    align-items: flex-end;
}

.bouldergain-modal-overlay.is-open {
    display: flex;
}

.bouldergain-modal-content {
    width: 100%;
    background-color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.bouldergain-modal-overlay.is-open .bouldergain-modal-content {
    transform: translateY(0);
}

.bouldergain-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.bouldergain-modal-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bouldergain-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

#bouldergain-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.bouldergain-modal-subheader {
    text-align: center;
    margin-bottom: 25px;
}

.bouldergain-modal-subheader h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px;
}

.bouldergain-unit-toggle {
    display: inline-flex;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 4px;
    border: 1px solid #e0e0e0;
}

.bouldergain-unit-toggle button {
    background-color: transparent;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 16px;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    color: #555;
}

.bouldergain-unit-toggle button.active {
    background-color: #fff;
    color: #000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

#bouldergain-modal-body table {
    width: 100%;
    border-collapse: collapse;
}

#bouldergain-modal-body th, 
#bouldergain-modal-body td {
    text-align: center;
    padding: 14px 8px;
    border-bottom: 1px solid #f0f0f0;
}

#bouldergain-modal-body th {
    font-weight: 600;
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
}

#bouldergain-modal-body td {
    font-size: 14px;
}

#bouldergain-modal-body tbody tr:last-child td {
    border-bottom: none;
}

/* --- Custom Product Carousel (Final Tweaks) --- */
.custom-product-carousel-wrapper {
    margin-bottom: 40px;
    overflow: hidden; /* Prevent horizontal scrollbar from swiper */
}

.custom-product-carousel-wrapper .carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px; /* Add some padding */
}

.custom-product-carousel-wrapper .carousel-header h2 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-product-carousel-wrapper .carousel-header .shop-all-link {
    text-decoration: underline;
    font-weight: 600;
    font-size: 12px;
}

.custom-product-carousel-wrapper .swiper-container {
    overflow: visible; /* Allow seeing partial next slide */
}

.custom-product-carousel-wrapper .swiper-slide {
    height: auto;
}

.custom-product-carousel-wrapper .product-inner {
    text-align: left;
}

.custom-product-carousel-wrapper .product-image-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;

}

.custom-product-carousel-wrapper .product-image-wrapper .attachment-woocommerce_thumbnail {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* This is the main container for the icons */
.custom-product-carousel-wrapper .product-inner .product-actions {
    position: absolute;
    top: 12px;
    left: 12px; /* Default to left for quick view */
    width: calc(100% - 24px); /* full width minus padding */
    display: flex;
    justify-content: space-between; /* Pushes items to ends */
    opacity: 1;
    z-index: 10;
    pointer-events: none; /* Allow clicking through the container */
}

.custom-product-carousel-wrapper .product-inner .action-item {
    pointer-events: auto; /* Make icons clickable */
}

/* General styling for both icons */
.custom-product-carousel-wrapper .product-inner .action-item > * {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    color: #000 !important;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    line-height: 1 !important;
}

/* Icon font-size */
.custom-product-carousel-wrapper .product-inner .action-item > * i,
.custom-product-carousel-wrapper .product-inner .action-item > *::before {
    font-size: 12px !important;
}

/* Specific for Quick View */
.custom-product-carousel-wrapper .product-inner .quick-view-item .show-quickly {
    font-size: 0 !important; /* Hide text, only show icon */
}
.custom-product-carousel-wrapper .product-inner .quick-view-item .et-quick-view {
    font-size: 12px !important;
    line-height: 1;
}
.custom-product-carousel-wrapper .product-inner .quick-view-item .et-quick-view:before {
    content: "\e90c"; /* shopping-basket icon */
}


/* Specific for Wishlist */
.custom-product-carousel-wrapper .product-inner .wishlist-item {
    margin: 0 !important;
    order: 2; /* Ensure it's on the right */
}
.custom-product-carousel-wrapper .product-inner .wishlist-item .yith-wcwl-add-to-wishlist {
    margin: 0 !important;
}
.custom-product-carousel-wrapper .product-inner .wishlist-item .yith-wcwl-add-to-wishlist a {
    font-size: 0 !important; /* Hide text */
}
.custom-product-carousel-wrapper .product-inner .wishlist-item .yith-wcwl-add-to-wishlist a:before {
    font-family: "xstore-icons" !important;
    content: "\e936" !important; /* Heart icon */
    font-size: 12px !important;
    font-weight: normal !important;
}
.custom-product-carousel-wrapper .product-inner .wishlist-item .yith-wcwl-add-to-wishlist.added a:before {
    content: "\e935" !important; /* Filled heart icon */
}
.custom-product-carousel-wrapper .product-inner .wishlist-item .ajax-loading {
    display: none !important;
}


.custom-product-carousel-wrapper .new-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 5;
}

.custom-product-carousel-wrapper .product-info {
    padding: 0 5px;
}

.custom-product-carousel-wrapper .product-info .product-title {
    font-size: 14px !important;
    line-height: 1.4 !important; /* Increased line-height for wrapping */
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: normal; /* Allow wrapping */
    overflow: visible;
    text-overflow: clip;
    height: 3.9em; /* Reserve space for up to 3 lines */
}

.custom-product-carousel-wrapper .product-info .product-title a {
    color: inherit;
    text-decoration: none;
}

.custom-product-carousel-wrapper .product-info .product-color {
    display: block;
    font-size: 13px !important;
    color: #8d8d8d !important;
    margin-bottom: 6px;
}

.custom-product-carousel-wrapper .product-info .price {
    font-size: 14px !important; /* Slightly larger for visibility */
    font-weight: 600;
    color: #000000 !important; /* Changed to black */
}

/* --- Mobile Carousel Adjustments (Final Fix) --- */
@media (max-width: 767px) {
    /* Make carousel full-bleed by breaking out of parent container's padding */
    .custom-product-carousel-wrapper {
        /* These values counteract the padding of the parent (e.g., Elementor column) */
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        max-width: calc(100% + 30px); /* Ensure max-width is also overridden */
    }

    /* Constrain the header width to the viewport and center it */
    .custom-product-carousel-wrapper .carousel-header {
        width: 100vw;
        margin-left: auto;
        margin-right: auto;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box; /* Include padding in width calculation */
    }

    /* Add padding back to the product info to keep it aligned */
    .custom-product-carousel-wrapper .product-info {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* --- Shop/Category Page Product Grid Styles --- */

/* Set grid spacing */
.products.grid .product {
    padding: 0 10px !important; /* 10px padding on each side creates 20px total gap */
    margin-bottom: 20px !important;
}
.products.grid {
    margin: 0 -10px !important; /* Negative margin on container to align grid */
}

/* Style the product info container */
.products .product .product-info {
    text-align: left;
    padding: 0 5px; /* Small padding for text */
}

/* Style the product title */
.products .product .product-info .product-title {
    font-size: 14px !important;
    line-height: 1.1 !important;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.products .product .product-info .product-title a {
    color: inherit;
    text-decoration: none;
}

/* Style the product color attribute */
.products .product .product-info .product-color {
    display: block;
    font-size: 13px !important;
    color: #8d8d8d !important;
    margin-bottom: 6px;
}

/* Style the price */
.products .product .product-info .price {
    font-size: 12px !important;
    font-weight: 600;
    color: #8d8d8d !important;
}

/* --- Action Icons on Shop/Category Pages --- */

/* This is the main container for the icons */
.products .product .product-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    display: flex;
    justify-content: space-between;
    opacity: 1;
    z-index: 10;
    pointer-events: none;
}

.products .product .product-actions .action-item {
    pointer-events: auto;
}

/* General styling for both icons */
.products .product .product-actions .action-item > * {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    color: #000 !important;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    line-height: 1 !important;
}

/* Icon font-size */
.products .product .product-actions .action-item > * i,
.products .product .product-actions .action-item > *::before {
    font-size: 12px !important;
}

/* Specific for Quick View */
.products .product .quick-view-item .show-quickly {
    font-size: 0 !important;
}
.products .product .quick-view-item .et-quick-view {
    font-size: 12px !important;
    line-height: 1;
}
.products .product .quick-view-item .et-quick-view:before {
    content: "\e90c";
}

/* Specific for Wishlist */
.products .product .wishlist-item {
    margin: 0 !important;
    order: 2;
}
.products .product .wishlist-item .yith-wcwl-add-to-wishlist {
    margin: 0 !important;
}
.products .product .wishlist-item .yith-wcwl-add-to-wishlist a {
    font-size: 0 !important;
}
.products .product .wishlist-item .yith-wcwl-add-to-wishlist a:before {
    font-family: "xstore-icons" !important;
    content: "\e936" !important;
    font-size: 12px !important;
    font-weight: normal !important;
}
.products .product .wishlist-item .yith-wcwl-add-to-wishlist.added a:before {
    content: "\e935" !important;
}
.products .product .wishlist-item .ajax-loading {
    display: none !important;
}

/* --- Product Info Box (Shipping/Returns) --- */
.bouldergain-info-box {
    background-color: #f3f3f3;
    border: none;
    border-radius: 4px;
    padding: 15px 20px;
    margin: 20px 0;
}

.bouldergain-info-box .info-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
}

.bouldergain-info-box .info-item:not(:last-child) {
    margin-bottom: 10px;
}

.bouldergain-info-box .info-item .info-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    line-height: 1;
    flex-shrink: 0; /* Prevents the icon from shrinking */
}

.bouldergain-info-box .info-item .info-icon .info-svg-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bouldergain-info-box .info-item p {
    margin: 0;
    padding: 0;
}

/* --- Boulders Carousel Styles (V2) --- */
.boulders-carousel-wrapper .swiper-container {
    width: 100%;
}

.boulders-carousel-wrapper .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.boulder-item {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.boulder-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    margin-bottom: 15px;
}

.boulder-details {
    padding: 0 10px;
}

.boulder-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    text-transform: uppercase;
}

.boulder-position {
    font-size: 14px;
    color: #777;
    margin: 0 0 10px;
}

.boulder-socials a {
    color: #333;
    margin: 0 7px;
    font-size: 18px;
    transition: color 0.3s ease;
}
.boulder-socials a:hover {
    color: #000;
}

/* Mobile Carousel Styles */
@media (max-width: 767px) {
    .boulders-carousel-wrapper .swiper-wrapper {
        display: flex; /* Revert to flex for swiper */
    }

    .boulders-carousel-wrapper .swiper-container {
        overflow: visible;
    }
    
    .boulders-carousel-wrapper .swiper-slide {
        height: auto; /* Ensure slides adapt to content height */
    }

    .boulders-carousel-wrapper.custom-product-carousel-wrapper {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
}
