:root {
    --pasture-main: #2E5A44;
    --pasture-accent: #418261;
    --pasture-light: #F0F5F2;
    --ocean-main: #1C3D5A;
    --ocean-accent: #2B5C8F;
    --ocean-light: #EBF2F7;
    --bg-light: #F4F7F5;
    --surface: #FFFFFF;
    --text-main: #17241C;
    --text-muted: #526359;
    --border: #D8E2DC;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/* Header & Brand Identity */
header {
    background-color: var(--ocean-main);
    border-bottom: 3px solid var(--pasture-accent);
    padding: 1.25rem 1.5rem;
    
    /* Sticky Placement Engine */
    position: sticky;
    top: 0;
    
    /* Ensures the header layers perfectly over moving cards and product images */
    z-index: 1000; 
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--surface);
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--ocean-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

nav a:hover, nav a.active {
    color: var(--surface);
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Completely Redesigned Modern Hero Section 
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--pasture-main) 0%, var(--ocean-main) 100%);
    color: var(--surface);
    padding: 4rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-wrapper {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column; /* Stacked by default on mobile */
    align-items: center;
    gap: 3rem;
    text-align: center;
}

/* Glassmorphism Shield to make the grey text highly visible */
.logo-glass-shield {
    background: rgba(255, 255, 255, 1); /* Bright backdrop so grey text pops */
    backdrop-filter: blur(12px); /* High-end modern blur effect */
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}


.hero-logo-img {
    width: 100%;
    max-width: 240px; /* Generous logo sizing */
    height: auto;
    object-fit: contain;
    display: block;
}

.hero-text-container {
    max-width: 550px;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--surface);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    color: var(--ocean-light);
    font-size: 1.15rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Desktop Media Query Upgrades */
@media (min-width: 768px) {
    .hero {
        padding: 6rem 2rem;
    }
    
    .hero-wrapper {
        flex-direction: row; /* Side-by-side on desktop */
        text-align: left;
        justify-content: space-between;
    }
    
    .hero-logo-container {
        flex: 1;
        display: flex;
        justify-content: flex-start;
    }
    
    .hero-text-container {
        flex: 1.2;
        max-width: none;
    }
    
    .hero h2 {
        font-size: 3rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* UI Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.controls input, .controls select {
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background-color: var(--surface);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.controls input:focus, .controls select:focus {
    border-color: var(--ocean-accent);
    box-shadow: 0 0 0 4px rgba(43, 92, 143, 0.15);
}

/* Grid & Brand Styled Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--pasture-accent);
    box-shadow: 0 12px 30px rgba(46, 90, 68, 0.08);
}

.card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    /* Tells the content container to stretch to fill the full height of the card */
    flex-grow: 1; 
}

/* Add this new rule to target buttons inside your grid cards */
.card-content .btn {
    /* Auto margin-top absorbs all extra whitespace above it, pushing the button to the bottom */
    margin-top: auto;
    width: 100%;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--ocean-main);
}

.card-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pasture-main);
    margin-bottom: 0.5rem;
}

/* Dynamic Details Page */
.detail-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.detail-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-info hr {
    border: 0;
    border-top: 2px solid var(--pasture-light);
    margin: 2rem 0;
}

/* ==========================================================================
   Sleek & Clean Cart Page Overhaul
   ========================================================================== */
.cart-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.cart-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ocean-main);
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

/* Modernized Line Item Cards */
.cart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.cart-card:hover {
    border-color: var(--pasture-accent);
    box-shadow: 0 8px 20px rgba(46, 90, 68, 0.04);
}

.cart-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-card-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.cart-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ocean-main);
    margin-bottom: 0.25rem;
}

.cart-card-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.cart-card-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.cart-card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.cart-remove-link {
    background: none;
    border: none;
    color: #CC0000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: var(--transition);
}

.cart-remove-link:hover {
    color: #880000;
}

/* Elegant Order Summary Sidebar */
.cart-summary-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.cart-summary-sidebar h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ocean-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.3px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.summary-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.total-row {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
}

.checkout-btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.continue-shopping-btn {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

.empty-cart-state {
    text-align: center;
    padding: 4rem 1rem;
    margin: auto;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.empty-cart-state p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Desktop Split Layout Adjustments */
@media (min-width: 992px) {
    .cart-page-layout {
        grid-template-columns: 1.6fr 1fr; /* Distinct items view on left, sticky sidebar on right */
        gap: 4rem;
    }
    
    .cart-summary-sidebar {
        position: sticky;
        top: 120px; /* Locks in place comfortably while scrolling items */
    }
}

/* Brand Buttons */
.btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--pasture-main);
    color: var(--surface);
    padding: 0.9rem 1.5rem;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(46, 90, 68, 0.2);
}

.btn:hover {
    background-color: var(--ocean-main);
    box-shadow: 0 4px 8px rgba(28, 61, 90, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    margin-top: 1rem;
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--surface);
    border-color: var(--text-main);
    color: var(--text-main);
    box-shadow: none;
}

footer {
    flex-shrink: 0;
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--ocean-main);
    color: var(--ocean-light);
    font-size: 0.9rem;
    border-top: 4px solid var(--pasture-main);
}

.brand-badge-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.brand-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Clean adaptive styling for flexible product types */
.card-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--pasture-main);
    background-color: var(--pasture-light);
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Custom Pop-up (Toast Notification)
   ========================================================================== */
.custom-toast {
    position: fixed;
    bottom: 20px; /* Sits perfectly at the bottom for thumb-reach on mobile */
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Hidden by default */
    background: rgba(28, 61, 90, 0.95); /* Deep Ocean Main with slight transparency */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--surface);
    padding: 1rem 2rem;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    width: max-content;
    max-width: 90vw;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Class applied by JavaScript when triggered */
.custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--pasture-accent);
    font-weight: bold;
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

#featuredGrid {
    display: flex;
    /* Centers the cards horizontally within the grid section */
    justify-content: center; 
    /* Allows multiple rows of cards to wrap naturally on smaller screens */
    flex-wrap: wrap; 
    gap: 2.5rem;
    width: 100%;
}

/* Tablet & Desktop adjustment */
@media (min-width: 768px) {
    .custom-toast {
        bottom: auto;
        top: 100px; /* Slides in neatly near the top header on desktop */
        transform: translateX(-50%) translateY(-100px);
    }
    .custom-toast.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* Desktop Polish updates */
@media (min-width: 768px) {
    header { padding: 1.25rem 2rem; }
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
    .controls {
        flex-direction: row;
    }
    .controls input { flex: 2; }
    .controls select { flex: 1; }
    
    .detail-container {
        flex-direction: row;
    }
    .detail-image, .detail-info {
        width: 50%;
    }
    .btn {
        display: inline-block;
        width: auto;
    }
    .cart-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .cart-item-details {
        gap: 3rem;
    }
    .cart-summary {
        text-align: right;
        max-width: 400px;
        margin-left: auto;
    }
    .grid {
        /* Automatically fits as many 250px columns as possible based on screen size */
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2.5rem;
    }
}

@media (min-width: 1200px) {
    .grid {
        /* Enforces a structured 4-column layout on standard desktop screens */
        grid-template-columns: repeat(4, 1fr);
    }
}
