/*
Theme Name: Toller
Theme URI: https://danniharris.com
Author: Andrew
Description: 
Version: 4.7
Text Domain: toller
*/

/* =========================================
   1. VARIABLES & SETUP
   ========================================= */
:root {
    --color-forest: #1B4D3E;
    --color-rust: #D96C48;
    --color-cream: #F7F5EB;
    --color-charcoal: #2C2C2C;
    --color-gold: #F4D03F;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-pill: 50px;
    --radius-card: 24px;
    --shadow-soft: 0 10px 40px rgba(27, 77, 62, 0.08);
    --container-width: 1400px;
}

* { box-sizing: border-box; }

/* Fix: Sticky Footer Layout */
body {
    background-color: var(--color-cream);
    color: var(--color-charcoal);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    font-size: 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-forest);
    margin-top: 0;
    line-height: 1.2;
    font-weight: 600;
}

a { color: var(--color-forest); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--color-rust); }

img { max-width: 100%; height: auto; border-radius: 12px; }

/* =========================================
   2. HEADER (Glassmorphism)
   ========================================= */
.site-header {
    position: sticky;
    top: 20px;
    z-index: 1000;
    margin: 0 auto 40px auto;
    width: 95%;
    max-width: var(--container-width);
}

.header-inner {
    background: rgba(255, 255, 255, 0.9); /* Slightly transparent */
    backdrop-filter: blur(12px); /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-pill);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    position: relative; 
}

/* --- DESKTOP ORDERING --- */
.site-branding {
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.5px;
    order: 1;
    margin-right: auto; 
}

.site-branding h1 { margin: 0; font-size: inherit; }

.main-navigation { order: 2; }
.header-cart { order: 3; margin-left: 30px; }

/* Desktop Nav Styles */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Mobile Menu Styles --- */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    width: 30px;
    height: auto;
    z-index: 1002;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-forest);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* --- Hamburger Animation (Using .is-active class) --- */
/* Top Line: Move down and rotate 45 deg */
.menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

/* Middle Line: Fade out */
.menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

/* Bottom Line: Move up and rotate -45 deg */
.menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 900px) {
    .header-inner {
        padding: 15px 20px;
        flex-wrap: wrap; 
        justify-content: space-between; 
        align-items: center;
    }

    .menu-toggle { display: flex !important; order: 1; }
    .site-branding { order: 2; flex-grow: 1; text-align: center; margin-right: 0; }
    .header-cart { order: 3; z-index: 20; margin-left: 0; }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        order: 4; 
        margin-top: 15px;
        
        /* GLASSMORPHISM RESTORED */
        background: rgba(255, 255, 255, 0.95); 
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.4);
        
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        padding: 20px;
        z-index: 1001;
    }

    .main-navigation.toggled { 
        display: block !important; 
        animation: slideDown 0.3s ease forwards;
    }

    .main-navigation ul { 
        flex-direction: column;
        gap: 10px; 
        text-align: center; 
    }
    
    .main-navigation li {
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .main-navigation li:last-child { border-bottom: none; }

    .main-navigation a { display: block; padding: 15px; font-size: 1.1rem; color: var(--color-forest); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   3. WOOCOMMERCE PRODUCT PAGE REDESIGN
   ========================================= */

/* Main Wrapper */
.site-main-wrapper {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

/* --- SINGLE PRODUCT LAYOUT --- */
.woocommerce div.product {
    display: grid;
    grid-template-columns: 1.2fr 1fr; 
    gap: 80px; 
    align-items: start;
}

/* Main Image Container */
.woocommerce div.product div.images {
    width: 100% !important;
    float: none !important;
    margin-bottom: 40px;
}

/* Main Image Styling */
.woocommerce div.product div.images img {
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(27, 77, 62, 0.15);
    width: 100%;
    transition: transform 0.3s ease;
}

/* --- FIXED GALLERY THUMBNAILS --- */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 20px !important;
    padding: 10px 5px 5px 5px !important; 
    justify-content: center;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    width: 80px !important; 
    height: 80px !important; 
    float: none !important;
    flex: 0 0 auto; 
    list-style: none !important;
    padding: 0 !important; 
}

.woocommerce-product-gallery .flex-control-thumbs img {
    border-radius: 12px !important;
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    border: 2px solid transparent;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover; 
}

.woocommerce-product-gallery .flex-control-thumbs img:hover,
.woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1;
    transform: translateY(-3px);
    border-color: var(--color-rust);
}

/* --- PRODUCT SUMMARY (Right Column) --- */
.woocommerce div.product div.summary {
    width: 100% !important;
    float: none !important;
    position: sticky;
    top: 120px; 
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.8);
}

.product_title {
    font-size: 3.5rem;
    margin-bottom: 15px;
    line-height: 1.1;
    color: var(--color-forest);
}

.price {
    color: var(--color-rust);
    font-weight: 700;
    font-size: 1.8rem !important;
    display: block;
    margin-bottom: 25px;
    font-family: var(--font-body);
}

.woocommerce-product-details__short-description {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.7;
}

/* --- NEW CREATIVE QUANTITY BOX --- */
.woocommerce div.product form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

/* Quantity Wrapper */
.woocommerce div.product .quantity {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--color-forest);
    border-radius: 50px;
    padding: 5px;
    width: auto;
    min-width: 140px;
    height: 54px;
}

/* The +/- Buttons */
button.qty-btn {
    background: transparent !important;
    color: var(--color-forest) !important;
    border: none !important;
    font-size: 1.5rem !important;
    width: 40px !important;
    height: 100% !important;
    padding: 0 !important;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
button.qty-btn:hover {
    color: var(--color-rust) !important;
    transform: none !important;
}

/* The Number Input */
.woocommerce div.product .quantity input.qty {
    border: none !important;
    background: transparent !important;
    width: 50px !important;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-charcoal);
    padding: 0 !important;
    height: 100% !important;
    -moz-appearance: textfield; 
}
.woocommerce div.product .quantity input.qty::-webkit-outer-spin-button,
.woocommerce div.product .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- ADD TO CART BUTTON --- */
.single_add_to_cart_button {
    flex-grow: 1;
    background-color: var(--color-forest) !important;
    color: #fff !important;
    padding: 16px 40px !important;
    border-radius: 50px !important;
    font-size: 1.1rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    transition: all 0.3s ease;
    height: 54px; 
}

.single_add_to_cart_button:hover {
    background-color: var(--color-rust) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(217, 108, 72, 0.3);
}

/* --- MOBILE RESPONSIVENESS FOR PRODUCT --- */
@media (max-width: 900px) {
    .woocommerce div.product {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .woocommerce div.product div.summary {
        position: static; 
        padding: 25px;
    }

    .product_title { font-size: 2.5rem; }
    
    .woocommerce div.product form.cart {
        flex-direction: column;
        align-items: stretch;
    }
    
    .woocommerce div.product .quantity {
        width: 100%;
        justify-content: space-between;
    }
    
    .single_add_to_cart_button {
        width: 100%;
    }
}

/* --- GRID FIXES (CENTERED) --- */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 320px));
    justify-content: center; 
    gap: 30px;
    margin-bottom: 40px;
}

.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }

.woocommerce ul.products li.product {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    width: 100% !important; 
    float: none !important; 
    margin: 0 !important;
}

.woocommerce ul.products li.product:hover { transform: translateY(-10px); box-shadow: var(--shadow-soft); }
.woocommerce ul.products li.product img { border-radius: 16px; margin-bottom: 15px; transition: transform 0.5s ease; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.woocommerce ul.products li.product:hover img { transform: scale(1.05); }
.woocommerce-loop-product__title { font-size: 1.3rem; margin-bottom: 8px; color: var(--color-forest); }
.price { color: var(--color-rust); font-weight: bold; font-size: 1.1rem; display: block; margin-bottom: 15px; }

/* Button Styling & Fix for "View Cart" Text */
.button { background: var(--color-forest) !important; color: white !important; border-radius: var(--radius-pill) !important; padding: 10px 20px !important; font-weight: bold; border: none; }

/* View Cart Link Styling - Forced Block for All Screens */
a.added_to_cart {
    display: block !important; 
    width: 100%;
    margin-left: 0;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-forest);
    padding: 5px 0;
}

/* --- Password Reveal Fix --- */
.woocommerce form .woocommerce-input-wrapper { position: relative; }
.show-password-input { 
    width: auto !important; background: transparent !important; color: var(--color-forest) !important;
    position: absolute !important; top: 50% !important; right: 10px !important; transform: translateY(-50%) !important;
    z-index: 100 !important; min-width: unset !important; margin: 0 !important; border: none !important; padding: 5px !important;
}
.woocommerce form .woocommerce-input-wrapper input[type="password"] { padding-right: 45px !important; }

/* =========================================
   4. CUSTOM FRONTPAGE STYLES
   ========================================= */
.hero-section {
    background-color: var(--color-forest);
    color: #fff;
    padding: 80px 20px 120px;
    position: relative;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
}
.hero-container { max-width: var(--container-width); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; }
.hero-text h1 { color: #fff; font-size: 4.5rem; margin-bottom: 20px; }
.hero-text p { font-size: 1.3rem; opacity: 0.9; margin-bottom: 30px; max-width: 500px; }
.hero-btn { background: var(--color-rust); color: white; padding: 18px 40px !important; font-size: 1.1rem !important; border-radius: var(--radius-pill); font-weight: bold; display: inline-block; width: auto; }
.hero-btn:hover { background: #fff; color: var(--color-forest); }
.hero-image img { border-radius: 40px; transform: rotate(3deg); border: 8px solid rgba(255,255,255,0.1); }
.wave-divider { position: absolute; bottom: 0; left: 0; width: 100%; line-height: 0; }
.wave-divider svg { position: relative; display: block; width: calc(100% + 1.3px); height: 80px; }
.wave-divider .shape-fill { fill: var(--color-cream); }

/* =========================================
   5. FOOTER & SILHOUETTES
   ========================================= */
.site-footer { background: var(--color-forest); color: white; text-align: center; padding: 80px 20px; margin-top: auto; position: relative; }
.site-footer a { color: #fff; text-decoration: underline; }

/* Adjusted for flat grass footer */
.silhouette-duck { 
    position: absolute; 
    bottom: 60px; /* Flying high */
    left: 5%; 
    width: 80px; 
    height: auto; 
    opacity: 0.9; 
    z-index: 20; 
}

.silhouette-toller { 
    position: absolute; 
    bottom: -2px; /* Running on the flat ground */
    left: auto; 
    right: 5%; 
    width: 140px; 
    height: auto; 
    opacity: 0.9; 
    z-index: 20; 
}

@media (max-width: 768px) {
    .silhouette-duck { width: 40px; bottom: 35px; left: 2%; }
    .silhouette-toller { width: 80px; bottom: -2px; right: 2%; }
}

@media (max-width: 900px) {
    .hero-container, 
    .woocommerce div.product {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-text h1 { font-size: 3rem; }
    .hero-image { margin-top: 40px; }
}