/*
Theme Name:   Groci Child
 Theme URI:    http://klbtheme.com/groci/
 Description:  Groci Child Theme
 Author:       KlbTheme
 Author URI:   http://themeforest.net/user/KlbTheme
 Template:     groci
 Version:      1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  groci-child
*/

/* Performance: Font Display Swap */
@font-face {
    font-family: "Material Design Icons";
    src: url("../vendor/icons/fonts/materialdesignicons-webfont.eot?v=5.3.45");
    src: url("../vendor/icons/fonts/materialdesignicons-webfont.eot?#iefix&v=5.3.45") format("embedded-opentype"), url("../vendor/icons/fonts/materialdesignicons-webfont.woff2?v=5.3.45") format("woff2"), url("../vendor/icons/fonts/materialdesignicons-webfont.woff?v=5.3.45") format("woff"), url("../vendor/icons/fonts/materialdesignicons-webfont.ttf?v=5.3.45") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}



/* Custom Product Page Styles */

/* 1. Flex Layout to align heights precisely */
@media (min-width: 768px) {
    .custom-product-flex-row {
        display: flex;
        align-items: stretch;
        gap: 0;
        /* No gap to ensure precise control */
    }
}

/* 2. Product Image: White background, centered in square, constrained height */
.custom-product-image-col {
    display: flex;
    flex-direction: column;
}

.custom-product-image-col .woocommerce-product-gallery {
    background: #fff;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 !important;
    /* Remove padding for edge-to-edge contain */
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .custom-product-image-col .woocommerce-product-gallery {
        height: 100% !important;
        /* Let flex stretch handle the alignment */
    }
}


/* Ensure the image behaves well inside the centered container - NO CROPPING */
.custom-product-image-col .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff;
}

.custom-product-image-col img {
    max-height: 100% !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
    /* FORCE CONTAIN TO PREVENT CROPPING */
    cursor: default !important;
    /* Link removed */
}

/* 3. High-Conversion CTA Button (Global: Product & Home/Loop) */

/* Target all possible Add to Cart button classes to ensure home page coverage */
.single_add_to_cart_button,
.add_to_cart_button,
.klb-product-item .button.add_to_cart_button,
.klb-product-item .button.product_type_external,
.groci-product-item .button.add_to_cart_button,
.groci-product-item .button.product_type_external,
a.button.product_type_simple,
a.button.product_type_external,
a.button.add_to_cart_button {

    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%) !important;
    /* Vibrant high-conversion gradient */
    color: #fff !important;
    font-size: 0.9rem !important;
    padding: 10px 30px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    margin-top: 18px;
    border-radius: 50px !important;
    /* Pill style */
    box-shadow: 0 4px 15px rgba(221, 36, 118, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

/* Home Page specific tweaks for the horizontal card layout */
.klb-product-item .button.add_to_cart_button,
.klb-product-item .button.product_type_external,
.groci-product-item .button.add_to_cart_button,
.groci-product-item .button.product_type_external,
.product-type-simple .add_to_cart_button,
.product-type-external .add_to_cart_button {
    padding: 5px 10px !important;
    /* Smaller buttons */
    font-size: 0.7rem !important;
    width: 80% !important;
    /* Slightly narrower */
    max-width: 160px !important;
    margin: 10px auto 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1 !important;
}

/* Hide the cart icon on home page/loops to save space and look cleaner */
.klb-product-item .button::before,
.groci-product-item .button::before,
.product-type-simple .add_to_cart_button::before,
.product-type-external .add_to_cart_button::before,
.related.products .button::before {
    display: none !important;
}


.single_add_to_cart_button:hover,
.add_to_cart_button:hover {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 4px 15px rgba(221, 36, 118, 0.4) !important;
    filter: brightness(1.05) !important;
    color: #fff !important;
}

.single_add_to_cart_button:active,
.add_to_cart_button:active {
    transform: translateY(-1px) scale(0.98) !important;
}


/* Add icon support if applicable */
.single_add_to_cart_button::before,
.add_to_cart_button::before {
    margin-right: 8px;
    font-family: "Material Design Icons";
    content: "\F0110";
    /* Cart icon */
    font-size: 1.2rem;
}


/* 4. Short Description highlight */
.custom-highlighted-description {
    background-color: #f0f7ff;
    border-left: 5px solid #ff512f;
    padding: 25px !important;
    border-radius: 8px;
    margin: 25px 0 !important;
    font-size: 1.15rem !important;
    line-height: 1.7;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.custom-highlighted-description p {
    margin-bottom: 0 !important;
}

/* 5. Premium Tabs Design */
.woocommerce-tabs.wc-tabs-wrapper {
    margin-top: 50px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.woocommerce-tabs ul.tabs.wc-tabs {
    background: #fdfdfd;
    border-bottom: 1px solid #eee;
    padding: 0 20px !important;
    margin: 0 !important;
    display: flex;
    list-style: none;
}

.woocommerce-tabs ul.tabs.wc-tabs li {
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-tabs ul.tabs.wc-tabs li a {
    padding: 20px 30px !important;
    display: block;
    font-weight: 600 !important;
    color: #666 !important;
    text-transform: uppercase;
    font-size: 0.9rem !important;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none !important;
    background: transparent !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
}

.woocommerce-tabs ul.tabs.wc-tabs li.active a {
    color: #ff512f !important;
    border-bottom: 3px solid #ff512f !important;
}

.woocommerce-tabs .klb-product-tab {
    padding: 40px !important;
}

/* 6. Premium Editorial Content (Inside Tabs) */
.klb-product-tab h2:first-of-type,
.klb-product-tab h3:first-of-type {
    font-size: 2rem !important;
    color: #222;
    margin-bottom: 25px !important;
    font-weight: 800 !important;
    line-height: 1.2;
}

.klb-product-tab p {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #555;
    margin-bottom: 20px !important;
}

/* --- Stage 2: UX Enhancements --- */

/* 7. Japan Trust Badge */
.japan-trust-badge {
    display: inline-flex;
    align-items: center;
    background: #fff5f5;
    border: 1px solid #ffccd2;
    padding: 6px 15px;
    border-radius: 50px;
    margin: 15px 0;
    font-weight: 600;
    color: #c92a2a;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-flag {
    margin-right: 10px;
    font-size: 1.2rem;
    line-height: 1;
}

/* 8. Mobile Floating CTA */
.mobile-floating-cta {
    position: fixed;
    bottom: -100px;
    /* Hidden below screen */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #eee;
    padding: 15px 0;
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: none;
    /* Hidden by default, shown via scroll or just mobile query */
}

.mobile-floating-cta.is-visible {
    bottom: 0;
}


@media (max-width: 991px) {
    .mobile-floating-cta {
        display: block;
    }

    /* Adjust bottom margin of body to avoid overlapping footer content if needed */
    body {
        padding-bottom: 80px;
    }
}

.btn-coral-gradient {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    padding: 10px 25px !important;
    border-radius: 50px !important;
    font-size: 0.9rem !important;
    box-shadow: 0 4px 15px rgba(221, 36, 118, 0.3) !important;
}

.product-info-mini .price {
    font-size: 1.2rem !important;
    font-weight: 800;
    color: #222;
}

/* 9. Responsive Tabs (Vertical on Mobile) */
@media (max-width: 767px) {
    .woocommerce-tabs ul.tabs.wc-tabs {
        flex-direction: column;
        padding: 0 !important;
    }

    .woocommerce-tabs ul.tabs.wc-tabs li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .woocommerce-tabs ul.tabs.wc-tabs li a {
        padding: 15px 20px !important;
        text-align: left;
    }

    .woocommerce-tabs ul.tabs.wc-tabs li.active a {
        background: #fdfdfd !important;
        border-left: 4px solid #ff512f !important;
        border-bottom: none !important;
    }

    .woocommerce-tabs .klb-product-tab {
        padding: 30px 20px !important;
    }

    .klb-product-tab h2:first-of-type {
        font-size: 1.6rem !important;
    }
}

/* 10. Cookie Banner Styling */
.cookie-banner-wrap {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 20px 0;
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cookie-banner-wrap.is-visible {
    bottom: 0;
}

/* Adjust for mobile floating CTA if present */
@media (max-width: 991px) {
    .cookie-banner-wrap.is-visible {
        bottom: 74px;
        /* Stack above the mobile buy button */
    }
}

.cookie-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.cookie-content a {
    color: #ff512f;
    text-decoration: underline;
    font-weight: 600;
}

#accept-cookies {
    min-width: 120px;
}

/* 11. High-Visibility Links */
a {
    transition: all 0.3s ease;
}

/* Content links should stand out but look elegant */
.entry-content a,
.klb-product-tab a,
.short-description a {
    color: #ff512f !important;
    text-decoration: none !important;
    font-weight: 400;
    /* Subtle weight */
}

.footer a,
.footer-bottom a,
.footer-widgets a,
.site-footer a,
.klb-footer a,
.footer .widget a,
.footer .widget ul li a,
.klbcopyright a,
.footer-fix-nav a,
.widget a {
    color: #ff512f !important;
    text-decoration: none !important;
    font-weight: 400;
    font-size: 0.9rem !important;
    /* Smaller for navigational links */
}

.entry-content a:hover,
.klb-product-tab a:hover,
.short-description a:hover,
.footer a:hover,
.footer-bottom a:hover,
.footer-widgets a:hover,
.klbcopyright a:hover,
.footer-fix-nav a:hover,
.site-footer a:hover,
.klb-footer a:hover,
.widget a:hover {
    color: #dd2476 !important;
    text-decoration: underline !important;
}

/* 12. Product Loop Normalization (Height Alignment) */
.klb-product-item,
.groci-product-item,
.product-type-simple.product,
.product-type-external.product,
.related.products .product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 460px !important;
    /* Slightly more compact */
    background: #fff;
    border-radius: 12px;
    padding: 0 10px 20px 10px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Soft outer shadow */
    transition: transform 0.3s ease;
}

.klb-product-item:hover,
.groci-product-item:hover,
.related.products .product:hover {
    transform: translateY(-5px);
}

/* Fix Image Height */
.klb-product-item .product-image,
.groci-product-item .product-image,
.product-type-simple .product-image,
.product-type-external .product-image,
.related.products .product-image {
    height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden;
    background: #fff;
    padding: 10px;
}

.klb-product-item .product-image img,
.groci-product-item .product-image img,
.product-type-simple .product-image img,
.product-type-external .product-image img,
.related.products .product-image img {
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Fix Title Height (Strict 2 lines for elegance) */
.klb-product-item h3,
.groci-product-item h3,
.klb-product-item .product-title,
.groci-product-item .product-title,
.related.products h2 {
    min-height: 42px !important;
    /* Fixed 2 lines */
    max-height: 42px !important;
    overflow: hidden;
    margin: 12px 0 8px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

/* Stock status alignment */
.klb-product-item .klb-stock,
.groci-product-item .klb-stock,
.product-type-simple .klb-stock,
.related.products .klb-stock {
    font-size: 0.75rem !important;
    margin-bottom: 5px !important;
    text-align: center;
}

/* Price area normalization */
.klb-product-item p.price,
.groci-product-item p.price,
.related.products p.price {
    min-height: 30px !important;
    margin-bottom: 10px !important;
    text-align: center !important;
}

/* Push buttons to bottom and refine size (Even smaller for elegance) */
.klb-product-item .product-footer,
.groci-product-item .product-footer,
.klb-product-item .button,
.groci-product-item .button,
.related.products .button {
    margin-top: auto !important;
    padding: 6px 16px !important;
    /* Even more compact */
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto !important;
    display: inline-block !important;
    align-self: center;
}

/* 13. Category Archive & Sidebar Refinements */

/* Category Header */
.category-header-clean {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 20px;
    margin-bottom: 30px !important;
}

.category-header-clean h1.page-title {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: #333;
    margin-bottom: 15px !important;
    letter-spacing: -0.5px;
}

.term-description {
    background: #fdfdfd;
    border-left: 4px solid #ff512f;
    padding: 20px 25px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.term-description p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 0;
}

/* Sidebar "Recommended Products" Widget Refinement */
.widget.woocommerce.widget_products,
.widget.woocommerce.widget_top_rated_products,
.widget.woocommerce.widget_recently_viewed_products {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid #f0f0f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    background: #fff !important;
}

.widget.woocommerce h4.widget-title,
.widget.woocommerce h3.widget-title {
    background: #fbfbfb !important;
    color: #333 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem !important;
    padding: 15px 20px !important;
}

.widget.woocommerce ul.product_list_widget {
    padding: 20px !important;
}

.widget.woocommerce ul.product_list_widget li {
    padding: 15px 0 !important;
    border-bottom: 1px solid #f8f8f8;
    display: flex !important;
    align-items: center !important;
}

.widget.woocommerce ul.product_list_widget li:last-child {
    border-bottom: none;
    padding-bottom: 0 !important;
}

.widget.woocommerce ul.product_list_widget li img {
    border: none !important;
    width: 65px !important;
    height: 65px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    background: #f9f9f9 !important;
    padding: 5px !important;
    margin-right: 15px !important;
    float: none !important;
}

.widget.woocommerce ul.product_list_widget li a {
    display: flex !important;
    align-items: center !important;
    color: #444 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.widget.woocommerce ul.product_list_widget li .product-title {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #444 !important;
    display: block !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
    margin-left: 2px !important;
}

.widget.woocommerce ul.product_list_widget li .amount {
    display: none !important;
    /* Remove price from sidebar as requested */
}