/*
Theme Name:   Storefront child 
Theme URI:    https://woocommerce.com/products/storefront/
Author:       Pure Pixels
Author URI:   https://purepixels.nl/
Template:     storefront
Description:  This is an unofficial child theme of the official Storefront theme
Version:      1.0
Tested up to: 6.7
Requires PHP: 5.6.0
License:      GNU General Public License v3 or later
License URI:  https://www.gnu.org/licenses/gpl-3.0.html
Text Domain:  storefront-child
*/

/* =====================
   BASE TYPOGRAPHY
   ===================== */
body,
button,
input,
textarea {
    font-family: "Inter", sans-serif;
    line-height: 1.618;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
}

.col-full {
    max-width: 85em;
}

/* =====================
   GLOBAL OVERLAY (MEGA MENU)
   ===================== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body:has(.mega-toggle-on)::after {
    opacity: 1;
    pointer-events: auto;
}

/* =====================
   HEADER LAYERING
   ===================== */
.site-header {
    position: relative;
    z-index: 99;
    padding-top: 0px !important;
}

/* =====================
   USP BAR
   ===================== */
.usp-bar {
    background-color: #10a858;
    border-bottom: 1px solid #004827;
    font-size: 0.8em;
    padding: 6px 0;
}

.usp-bar .col-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.usp-list {
    display: flex;
    gap: 1.5rem;
}

.usp-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #FFF;
}

.usp-item svg {
    color: #004827;
    flex-shrink: 0;
}

.usp-links a {
    color: #FFF;
    text-decoration: none;
}

.usp-links a:hover {
    color: #004827;
    text-decoration: underline;
}

ul#menu-topbar_nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

ul#menu-topbar_nav li {
    display: inline-block;
    margin-left: 15px;
}

/* =====================
   MASTHEAD / HEADER LAYOUT
   ===================== */
.masthead {
    padding: 1rem 0;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.masthead .col-full {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-areas: "branding search cart";
    align-items: center;
}

.masthead .site-branding { grid-area: branding; }
.masthead .header-search { grid-area: search; }
.masthead .site-header-cart {
    grid-area: cart;
    justify-self: end;
    white-space: nowrap;
}

/* =====================
   SEARCH BAR
   ===================== */
.header-search form {
    display: flex;
    width: 100%;
    border: 2px solid #222;
    border-radius: 3px;
    overflow: hidden;
    margin: 0;
}

.header-search input[type="search"] {
    flex: 1;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    border: none;
    outline: none;
    box-shadow: none;
    background: #fff;
}

.header-search button[type="submit"] {
    padding: 0.65rem 1.5rem;
    background-color: #2e7d32;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.header-search button[type="submit"]:hover {
    background-color: #1b5e20;
}

/* =====================
   MAIN NAVIGATION
   ===================== */
.main-navigation {
    background-color: #f1f1f1;
    width: 100% !important;
}

.main-navigation .col-full {
    display: flex;
}

#mega-menu-wrap-primary {
    width: 100% !important;
}

.main-navigation ul.menu {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-navigation ul.menu > li {
    flex: 1;
    text-align: center;
    position: relative;
}

.main-navigation ul.menu > li > a {
    display: block;
    padding: 0.85rem 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.main-navigation ul.menu > li > a:hover,
.main-navigation ul.menu > li:hover > a {
    background-color: rgba(0,0,0,0.15);
}

.mega-sub-menu .mega-menu-link:hover {
    text-decoration: underline !important;
}

#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard {
    padding: 5px 15px;
}

/* =====================
   WOOCOMMERCE UI BASE
   ===================== */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.widget a.button,
button.alt,
input[type="button"].alt,
input[type="reset"].alt,
input[type="submit"].alt,
.button.alt,
.widget-area .widget a.button.alt,
.wc-block-components-button:not(.is-link),
.added_to_cart,
.site-header-cart .widget_shopping_cart a.button,
.wc-block-grid__products .wc-block-grid__product .wp-block-button__link {
    background-color: #10a858;
    border-color: #10a858;
    color: #fff;
    transition: .2s all ease-in-out;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.button:hover,
.widget a.button:hover,
button.alt:hover,
input[type="button"].alt:hover,
input[type="reset"].alt:hover,
input[type="submit"].alt:hover,
.button.alt:hover,
.widget-area .widget a.button.alt:hover,
.wc-block-components-button:not(.is-link):hover,
.wc-block-components-button:not(.is-link):focus,
.wc-block-components-button:not(.is-link):active,
.added_to_cart:hover,
.site-header-cart .widget_shopping_cart a.button:hover,
.wc-block-grid__products .wc-block-grid__product .wp-block-button__link:hover {
    background-color: #004827;
    border-color: #004827;
    color: #fff;
}

/* =====================
   FORMS & INPUTS
   ===================== */
input[type=checkbox],
input[type=radio] {
    accent-color: #10a858;
}

/* =====================
   PRODUCT GRID
   ===================== */
.site-main ul.products.columns-3 li.product {
    width: 32% !important;
    float: left;
    margin-right: 1% !important;
    margin-bottom: 1.5rem !important;
    background: #F9F9F9;
    padding: 8px;
    box-sizing: border-box;
    transition: box-shadow 200ms ease;
}

.site-main ul.products.columns-3 li.product:nth-child(3n) {
    margin-right: 0 !important;
}

.site-main ul.products.columns-3 li.product:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* =====================
   PRODUCT TEXT TRUNCATION
   ===================== */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wp-block-post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: calc(1.4em * 2);
}

/* =====================
   PRODUCT WIDGETS
   ===================== */
.product_list_widget li > a {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    height: 24px;
}

/* =====================
   BADGES / SALE LABEL
   ===================== */
.post-type-archive-product span.onsale,
.tax-product_cat span.onsale {
    position: absolute;
    top: 15px;
    right: 15px;
    background: black;
    color: #fff;
    border: none;
    border-radius: 50px;
}

/* =====================
   WOOCOMMERCE LAYOUT FIXES
   ===================== */
.woocommerce-active .site-header .site-header-cart,
.woocommerce-active .site-header .site-search {
    width: 90%;
}

.wc-block-components-order-summary .wc-block-components-order-summary-item__quantity {
    background-color: #10a858;
}

/* =====================
   FILTER PLUGIN (YITH)
   ===================== */
.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item.active > a,
.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item.active > label > a {
    color: #10a858 !important;
}

.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item > a:hover,
.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item > label > a:hover {
    color: #10a858 !important;
}

.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item > a,
.yith-wcan-filters .yith-wcan-filter .filter-items .filter-item > label > a {
    position: relative;
    top: -1px;
}

/* =====================
   MOBILE
   ===================== */
@media (max-width: 768px) {
    .masthead .col-full {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "branding cart"
            "search search";
        gap: 0.75rem;
    }

    .usp-list {
        flex-direction: column;
        gap: 0.25rem;
    }

    .usp-bar {
        display: none;
    }

    .main-navigation ul.menu {
        flex-direction: column;
    }

    .main-navigation ul.menu > li {
        flex: none;
    }
}