/*
Theme Name: Sana Essentia Theme
Theme URI: https://sana-essentia.it
Author: Antonio Rossetti
Description: Custom conversion-focused theme for Sana Essentia.
Version: 1.1
Text Domain: sana-essentia
*/

:root {
    /* Palette */
    --color-primary: #2F5233; /* Deep Green - Trust/Authority */
    --color-primary-hover: #1E3621;
    --color-accent: #A4C639; /* Fresh Green - Vitality */
    --color-earth: #F2E8CF; /* Beige - Natural */
    --color-earth-light: #FAF6E9;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-white: #FFFFFF;
    --color-error: #D32F2F;
    --color-success: #388E3C;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    
    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: "Georgia", serif; /* Elegant, trustworthy for headings */
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 50px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-white);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: var(--color-white);
}

.btn-secondary {
    background-color: var(--color-earth);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: #E0D4B0;
}

.btn-large {
    font-size: 1.125rem;
    padding: 16px 32px;
}

/* Header */
.site-header {
    padding: var(--spacing-sm) 0;
    background: var(--color-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--color-text);
    font-weight: 500;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .main-navigation {
        display: none; /* Simplification for now */
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    background-color: var(--color-earth-light); /* Fallback */
    background-size: cover;
    background-position: center;
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85); /* Light overlay for readability */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-headline {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.hero-subheadline {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.hero-cta-group {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* Problems Grid */
.problems-section {
    padding: var(--spacing-lg) 0;
    background: var(--color-white);
}

.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.problem-card {
    background: var(--color-earth-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    transition: transform 0.2s;
}

.problem-card:hover {
    transform: translateY(-5px);
}

/* 
   WOOCOMMERCE SHOP IMPROVEMENTS 
*/

/* Shop Filters (Pills) */
.shop-filters-container {
    margin: 2rem 0;
    text-align: center;
}

.shop-category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-pill {
    padding: 8px 16px;
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.9rem;
    background: transparent;
    transition: all 0.2s ease;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

/* Product Grid Layout */
ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

ul.products::before,
ul.products::after {
    display: none; /* Remove float clears */
}

/* Product Card Styling */
ul.products li.product {
    width: 100% !important; /* Override Woo float width */
    margin: 0 !important;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    padding-bottom: 20px;
}

ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* Product Image */
ul.products li.product a img {
    margin: 0 auto 15px;
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: contain; /* Use contain to show full product, or cover for lifestyle */
    background: #f9f9f9; /* Background for transparent PNGs */
}

/* Product Title */
ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text);
    padding: 0 15px;
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 2.6em; /* Ensure 2 lines alignment */
}

/* Price */
ul.products li.product .price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 15px;
}

ul.products li.product .price del {
    color: #999;
    font-size: 0.9rem;
    font-weight: normal;
    opacity: 0.7;
    margin-right: 5px;
}

ul.products li.product .price ins {
    text-decoration: none;
}

/* Add to Cart Button */
ul.products li.product .button {
    margin-top: auto; /* Push to bottom */
    background-color: var(--color-primary);
    color: white !important;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: background 0.2s;
}

ul.products li.product .button:hover {
    background-color: var(--color-primary-hover);
}

ul.products li.product .button.loading {
    opacity: 0.7;
}

/* Sale Badge */
.woocommerce span.onsale {
    background-color: var(--color-accent);
    color: var(--color-primary);
    font-weight: bold;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    line-height: 50px; /* Center vertical */
    padding: 0;
    top: 10px;
    left: 10px; /* Left align looks more standard modern */
    right: auto;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Single Product Page Enhancements */
.woocommerce div.product .product_title {
    color: var(--color-primary);
    font-family: var(--font-heading);
}

.woocommerce div.product .price {
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: bold;
}

.woocommerce button.button.alt {
    background-color: var(--color-primary);
    border-radius: var(--radius-pill);
    padding: 16px 32px;
}

.woocommerce button.button.alt:hover {
    background-color: var(--color-primary-hover);
}

.sticky-cta-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
}

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

/* 
   MISSING STYLES RESTORED & NEW ADDITIONS 
*/

/* Hide Ghost Product */
.product_cat-uncategorized,
.product_cat-senza-categoria,
.post-15 {
    display: none !important;
}

/* Shop Button Styling */
.shop-btn-desktop {
    background-color: var(--color-earth) !important;
    color: var(--color-primary) !important;
}
.shop-btn-desktop:hover {
    background-color: #E0D4B0 !important;
}

/* Single Product Layout Fix */
.woocommerce div.product {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    margin-top: 2rem;
}

.woocommerce div.product div.images {
    flex: 1 1 400px;
    width: auto !important; /* Override Woo float */
    float: none !important;
    margin-bottom: 2rem;
}

.woocommerce div.product div.summary {
    flex: 1 1 400px;
    width: auto !important; /* Override Woo float */
    float: none !important;
}

/* Tabs Styling */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
    margin: 0 0 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 2rem;
    overflow: hidden;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: none;
    background: transparent;
    margin: 0;
    padding: 10px 0;
    border-radius: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    border-bottom: 2px solid var(--color-primary);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--color-primary);
}

.woocommerce div.product .woocommerce-tabs .panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    max-width: 900px; /* Improve readability */
    margin: 0 auto; /* Center if constrained */
}

.woocommerce div.product .woocommerce-tabs .panel p {
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.woocommerce div.product .woocommerce-tabs .panel h2, 
.woocommerce div.product .woocommerce-tabs .panel h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

/* RELATED PRODUCTS */
.related.products {
    margin-top: 4rem;
}

.related.products h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Responsive Single Product */
@media (max-width: 768px) {
    .woocommerce div.product {
        gap: 2rem;
        padding: 1.5rem;
        flex-direction: column;
    }

    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        flex: 1 1 100%;
    }
    
    .woocommerce div.product .product_title {
        font-size: 1.8rem;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        border-bottom: 1px solid #eee;
        padding: 10px 0;
        width: 100%;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li.active {
        border-bottom: 2px solid var(--color-primary);
    }
    
    /* Add padding to footer to prevent overlap */
    footer {
        padding-bottom: 80px;
    }
}

/* 
   MOBILE NAVIGATION 
*/

/* Default State (Desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

/* Mobile State */
@media (max-width: 991px) {
    /* Header Layout */
    .header-inner {
        justify-content: space-between;
    }
    
    .shop-btn-desktop {
        display: none; /* Hide desktop shop button */
    }

    /* Toggle Button */
    .menu-toggle {
        display: block;
    }
    
    /* Active Toggle Animation (X) */
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Navigation Overlay */
    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%); /* Hidden by default */
        transition: transform 0.3s ease-in-out;
        padding: 2rem;
    }

    .main-navigation.toggled {
        transform: translateX(0); /* Slide in */
    }
    
    /* Menu Items */
    .main-navigation ul {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        margin: 0;
        padding: 0;
    }
    
    .main-navigation ul li {
        margin: 0;
    }
    
    .main-navigation ul li a {
        font-size: 1.5rem;
        font-family: var(--font-heading);
        color: var(--color-primary);
    }
    
    /* Add Shop Button in Mobile Menu */
    .main-navigation::after {
        content: "Shop";
        display: block;
        margin-top: 2rem;
        padding: 12px 40px;
        background: var(--color-earth);
        color: var(--color-primary);
        font-weight: 600;
        border-radius: 30px;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    /* Prevent scrolling when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}
