/* ===========================
   CSS Variables / Design Tokens
   =========================== */
:root {
    --primary: #8B4513;
    --primary-light: #A0522D;
    --primary-dark: #6B3410;
    --accent: #C2703E;
    --accent-light: #D4884F;

    --bg: #FAF7F2;
    --bg-card: #FFFFFF;
    --bg-secondary: #F3EDE4;
    --bg-dark: #2D1810;

    --text: #2D1810;
    --text-secondary: #7A6B63;
    --text-muted: #A89B93;
    --text-inverse: #FAF7F2;

    --border: #E8DFD4;
    --border-light: #F0EAE1;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(45,24,16,0.06);
    --shadow-md: 0 4px 12px rgba(45,24,16,0.08);
    --shadow-lg: 0 8px 30px rgba(45,24,16,0.12);
    --shadow-xl: 0 16px 50px rgba(45,24,16,0.15);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --container: 1200px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul { list-style: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.font-serif {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ===========================
   Header
   =========================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.6875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(139, 69, 19, 0.08);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.mobile-menu.open {
    display: block;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-link {
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: flex; }
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(139, 69, 19, 0.08);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    max-width: 700px;
    margin: 0 auto 16px;
    text-wrap: balance;
}

.hero p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.7;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 69, 19, 0.04);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.8125rem;
}

/* ===========================
   Section Titles
   =========================== */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.section-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

.section-link:hover {
    gap: 8px;
}

/* ===========================
   Category Cards
   =========================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.category-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    color: var(--primary);
}

.category-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.category-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===========================
   Product Grid
   =========================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

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

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-img img {
    transform: scale(1.05);
}

.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: var(--primary);
    color: var(--text-inverse);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-card-category {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.product-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card-footer {
    padding: 0 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.product-card-link:hover {
    gap: 8px;
}

/* No image placeholder */
.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.no-image svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* ===========================
   Search & Filters Bar
   =========================== */
.filters-bar {
    padding: 32px 0 0;
}

.search-wrapper {
    position: relative;
    max-width: 480px;
    margin-bottom: 24px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-pill {
    padding: 8px 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.results-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 16px 0 8px;
}

/* ===========================
   Page Header / Breadcrumb
   =========================== */
.page-header {
    padding: 40px 0 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.breadcrumb-sep {
    color: var(--border);
}

.page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--text);
    text-wrap: balance;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-wrap: pretty;
}

/* ===========================
   Product Detail
   =========================== */
.product-detail {
    padding: 40px 0 80px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 96px;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 8px 0;
}

.product-info .product-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(139, 69, 19, 0.08);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-info h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 16px;
    text-wrap: balance;
}

.product-price-tag {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.product-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.product-description p {
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.product-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.product-meta-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.product-meta-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.product-meta-value {
    font-weight: 600;
    color: var(--text);
}

/* Nutritional table */
.nutrition-section {
    margin-top: 32px;
}

.nutrition-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.nutrition-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.nutrition-table-wrapper th,
.nutrition-table-wrapper td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text);
}

.nutrition-table-wrapper thead th {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nutrition-table-wrapper tbody tr:hover td {
    background: var(--bg-secondary);
}

.nutrition-table-wrapper tbody th {
    font-weight: 600;
    background: var(--bg-secondary);
}

.nutrition-table-wrapper h3 {
    padding: 12px 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.nutrition-table-wrapper ul {
    padding: 12px 16px 12px 32px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    list-style: disc;
}

.nutrition-table-wrapper li {
    margin-bottom: 4px;
}

.nutrition-table-wrapper p {
    padding: 8px 16px;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .product-gallery {
        position: static;
    }
}

/* ===========================
   Related Products
   =========================== */
.related-section {
    padding: 60px 0 80px;
    border-top: 1px solid var(--border);
}

/* ===========================
   Empty State
   =========================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand .logo-icon {
    background: rgba(255,255,255,0.15);
}

.footer-brand .logo-name {
    color: var(--text-inverse);
}

.footer-desc {
    font-size: 0.875rem;
    color: rgba(250, 247, 242, 0.6);
    line-height: 1.7;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
    color: rgba(250, 247, 242, 0.4);
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    font-size: 0.875rem;
    color: rgba(250, 247, 242, 0.7);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--text-inverse);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: rgba(250, 247, 242, 0.4);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ===========================
   Loading Skeleton
   =========================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===========================
   Fade In Animation
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease both;
}

.product-card {
    animation: fadeInUp 0.4s ease both;
}

.products-grid .product-card:nth-child(1) { animation-delay: 0.03s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.06s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.09s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.12s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.15s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.18s; }
.products-grid .product-card:nth-child(7) { animation-delay: 0.21s; }
.products-grid .product-card:nth-child(8) { animation-delay: 0.24s; }

/* ===========================
   Stats / Features Row
   =========================== */
.features-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    padding: 48px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.feature-item {
    text-align: center;
    padding: 24px 16px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(139, 69, 19, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--primary);
}

.feature-item h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ===========================
   Utilities
   =========================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
