/* css/style.css */

/* --- 1. CSS Variables & Reset --- */
:root {
    /* Color Palette - Premium HSL Colors Dark Green and Vibrant Mint */
    --clr-surface: hsl(0, 0%, 98%);
    --clr-surface-light: hsl(0, 0%, 100%);
    --clr-primary: hsl(150, 60%, 40%);
    --clr-primary-light: hsl(150, 70%, 50%);
    --clr-primary-dark: hsl(155, 75%, 25%);
    --clr-secondary: hsl(45, 100%, 55%);
    --clr-text: hsl(0, 0%, 15%);
    --clr-text-light: hsl(0, 0%, 40%);
    --clr-text-muted: hsl(0, 0%, 65%);
    --clr-border: hsl(0, 0%, 90%);
    --clr-danger: hsl(350, 80%, 55%);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Layout */
    --max-width: 1280px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-card: 0 2px 10px rgba(0,0,0,0.03);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--clr-surface);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* --- 2. Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--clr-text);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -1px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.5px; }
h3 { font-size: 1.5rem; }

/* --- 3. Buttons & Inputs --- */
.btn-primary, .btn-secondary, .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-primary));
    color: white;
    box-shadow: 0 4px 15px hsla(150, 60%, 40%, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(150, 60%, 40%, 0.4);
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
}

.btn-secondary {
    background: var(--clr-secondary);
    color: var(--clr-text);
    box-shadow: 0 4px 15px hsla(45, 100%, 55%, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(45, 100%, 55%, 0.4);
    background: hsl(45, 100%, 50%);
}

.btn-small { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-full { width: 100%; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--clr-primary);
    color: var(--clr-primary);
}

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

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background: var(--clr-surface-light);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px hsla(150, 60%, 40%, 0.1);
}

/* --- 4. Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.app-container {
    padding-top: 80px; /* Offset for navbar */
    min-height: calc(100vh - 300px);
}

/* --- 5. Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all var(--transition-fast);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-highlight {
    color: var(--clr-primary);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    position: relative;
}

.search-bar input {
    border-radius: var(--radius-xl);
    padding-left: 1.5rem;
    padding-right: 3rem;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--clr-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform var(--transition-smooth);
}
.cart-icon-wrapper:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--clr-danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}

/* --- 6. Hero Section --- */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 2rem auto;
    max-width: var(--max-width);
    background: linear-gradient(120deg, var(--clr-primary), var(--clr-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    padding: 4rem 3rem;
    box-shadow: var(--shadow-soft);
}

.hero-content {
    flex: 1;
    z-index: 2;
}

.hero h1 { margin-bottom: 1rem; color: white;}
.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 500px;
}

.hero-graphics {
    position: absolute;
    right: -5%;
    bottom: -10%;
    font-size: 20vw;
    opacity: 0.2;
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 1;
}

/* --- 7. Sections (Categories & Products) --- */
.section-title {
    margin: 3rem 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--clr-surface-light);
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: 1px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--clr-primary-light);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--clr-surface-light);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--clr-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    transition: transform var(--transition-smooth);
}
.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--clr-text);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--clr-primary-dark);
}

/* --- 8. Shopping Cart Sidebar --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: absolute;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--clr-surface-light);
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-smooth);
}

.cart-overlay.active .cart-sidebar {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-text-muted);
    transition: color var(--transition-fast);
}
.close-cart:hover { color: var(--clr-danger); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--clr-border);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    background: var(--clr-surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.cart-item-info { flex: 1; }
.cart-item-title { font-weight: 600; font-size: 0.95rem; }
.cart-item-price { color: var(--clr-primary-dark); font-weight: 700; }

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 4px;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    cursor: pointer;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--clr-danger);
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--clr-border);
    background: var(--clr-surface-light);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* --- 9. Forms & Details --- */
.form-card {
    background: var(--clr-surface-light);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 500px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.product-detail-image {
    background: var(--clr-surface-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10rem;
    padding: 3rem;
    aspect-ratio: 1;
}

.product-detail-info h1 { margin-bottom: 0.5rem; }
.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--clr-primary-dark);
    margin-bottom: 1.5rem;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.qty-selector input {
    width: 60px;
    text-align: center;
    font-size: 1.1rem;
}

/* --- 10. Admin Table --- */
.admin-table-container {
    overflow-x: auto;
    background: var(--clr-surface-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--clr-border);
}

.admin-table th {
    background: var(--clr-surface);
    font-weight: 600;
}

/* --- 11. Notifications --- */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--clr-text);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-hover);
    transition: bottom var(--transition-smooth);
    z-index: 3000;
    font-weight: 500;
}
.toast.show {
    bottom: 30px;
}

/* --- 12. Footer --- */
.footer {
    background: var(--clr-text);
    color: white;
    padding: 4rem 1.5rem 1rem;
    margin-top: 4rem;
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col a {
    display: block;
    color: var(--clr-text-muted);
    margin-bottom: 0.8rem;
}

.footer-col a:hover {
    color: var(--clr-primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--clr-text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-container { flex-wrap: wrap; }
    .search-bar { order: 3; max-width: 100%; margin-top: 1rem; }
    .nav-links { display: none; } /* Could add hamburger menu */
    .product-detail-layout { grid-template-columns: 1fr; }
    .hero { padding: 3rem 1.5rem; flex-direction: column; text-align: center; }
}
