/* ============================================================
   main.css — Woodview Butchery Design System
   v1.0
   ============================================================ */

/* ============================================================
   1. CSS Custom Properties
   ============================================================ */
:root {
    /* Brand Colours */
    --gold: #C9A227;
    --gold-hover: #a8841f;
    --gold-light: #f5e9c0;
    --black: #0D0D0D;
    --red: #B3202A;
    --red-hover: #8f1a22;
    --white: #FFFFFF;
    --off-white: #FAF8F4;
    --light: #F3F0EA;
    --mid-grey: #9A9A9A;
    --dark-grey: #4A4A4A;
    --border: #E0DBD0;
    --border-focus: #C9A227;

    /* Semantic Colours */
    --success: #2d7a2d;
    --error: #B3202A;
    --warning: #c97a00;
    --info: #1a6fa8;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Lato', 'Open Sans', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-xxl: 64px;

    /* Border Radius */
    --radius: 4px;
    --radius-lg: 8px;
    --radius-pill: 50px;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --transition: 0.2s ease;

    /* Layout */
    --header-height: 80px;
    --container-max: 1200px;
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--off-white);
    color: var(--black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    font-weight: 700;
    color: var(--black);
}

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

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul.list-unstyled,
ol.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============================================================
   3. Typography Scale
   ============================================================ */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }
.text-4xl  { font-size: 2.25rem; }

.font-heading  { font-family: var(--font-heading); }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-muted { color: var(--mid-grey); }
.text-gold  { color: var(--gold); }
.text-red   { color: var(--red); }

.lead {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--dark-grey);
}

/* ============================================================
   4. Layout Utilities
   ============================================================ */
.site-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Flexbox */
.d-flex        { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

/* Row / Col */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--space-md));
}
.col {
    flex: 1;
    padding: 0 var(--space-md);
}

/* Spacing helpers */
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-xxl { margin-top: var(--space-xxl); }

.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-xxl { margin-bottom: var(--space-xxl); }

.py-xs  { padding-top: var(--space-xs);  padding-bottom: var(--space-xs); }
.py-sm  { padding-top: var(--space-sm);  padding-bottom: var(--space-sm); }
.py-md  { padding-top: var(--space-md);  padding-bottom: var(--space-md); }
.py-lg  { padding-top: var(--space-lg);  padding-bottom: var(--space-lg); }
.py-xl  { padding-top: var(--space-xl);  padding-bottom: var(--space-xl); }
.py-xxl { padding-top: var(--space-xxl); padding-bottom: var(--space-xxl); }

.px-xs  { padding-left: var(--space-xs);  padding-right: var(--space-xs); }
.px-sm  { padding-left: var(--space-sm);  padding-right: var(--space-sm); }
.px-md  { padding-left: var(--space-md);  padding-right: var(--space-md); }
.px-lg  { padding-left: var(--space-lg);  padding-right: var(--space-lg); }
.px-xl  { padding-left: var(--space-xl);  padding-right: var(--space-xl); }
.px-xxl { padding-left: var(--space-xxl); padding-right: var(--space-xxl); }

.w-full { width: 100%; }

.hidden { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   5. Announcement Bar
   ============================================================ */
.announcement-bar {
    background: var(--black);
    color: var(--gold);
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-align: center;
    padding: 8px 16px;
    letter-spacing: 0.5px;
}

.announcement-bar a {
    color: var(--gold);
    text-decoration: underline;
}

/* ============================================================
   6. Site Header / Navbar
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 2px solid var(--gold);
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: box-shadow var(--transition);
}

.site-header.header-scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Brand Logo */
.brand-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
}

.brand-logo:hover {
    color: var(--black);
}

.brand-logo img {
    height: 48px;
    width: auto;
}

.brand-logo .logo-text {
    color: var(--black);
}

.brand-logo .logo-text span {
    color: var(--gold);
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav > li {
    position: relative;
}

.desktop-nav > li > a,
.desktop-nav > li > button.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.desktop-nav > li > a:hover,
.desktop-nav > li > button.nav-link:hover {
    color: var(--gold);
    background: var(--light);
}

.desktop-nav > li > a.active,
.desktop-nav > li > button.nav-link.active {
    color: var(--gold);
}

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-sm) 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition);
    z-index: 100;
}

.desktop-nav > li:hover .nav-dropdown,
.desktop-nav > li:focus-within .nav-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.nav-dropdown li a {
    display: block;
    padding: 9px 20px;
    font-size: 0.9rem;
    color: var(--dark-grey);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav-dropdown li a:hover {
    background: var(--light);
    color: var(--gold);
}

.nav-dropdown li a.active {
    color: var(--gold);
    font-weight: 600;
}

/* Dropdown arrow indicator */
.nav-caret {
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    display: inline-block;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform var(--transition);
}

.desktop-nav > li:hover .nav-caret {
    transform: rotate(-135deg);
    margin-top: 2px;
}

/* Header Utilities (right side) */
.header-utils {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--black);
    cursor: pointer;
    font-size: 1.25rem;
    transition: color var(--transition), background var(--transition);
    text-decoration: none;
}

.header-icon-btn:hover {
    color: var(--gold);
    background: var(--light);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--red);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Mobile Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 4px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.hamburger:hover {
    background: var(--light);
}

.hamburger-span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--black);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition), width var(--transition);
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.is-open .hamburger-span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger-span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger.is-open .hamburger-span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   7. Mobile Nav Drawer
   ============================================================ */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 300px;
    max-width: 85vw;
    background: var(--white);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--light);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--dark-grey);
    transition: background var(--transition), color var(--transition);
}

.mobile-nav-close:hover {
    background: var(--gold-light);
    color: var(--gold);
}

.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li a,
.mobile-nav-links li button.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-bottom: 1px solid var(--light);
}

.mobile-nav-links li a:hover,
.mobile-nav-links li button.mobile-nav-link:hover {
    background: var(--light);
    color: var(--gold);
}

.mobile-nav-links li a.active {
    color: var(--gold);
    background: var(--gold-light);
}

/* Categories accordion in mobile drawer */
.mobile-nav-accordion {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    background: var(--off-white);
}

.mobile-nav-accordion.open {
    max-height: 500px;
}

.mobile-nav-accordion a {
    display: block;
    padding: 10px var(--space-xl);
    font-size: 0.9rem;
    color: var(--dark-grey);
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
    border-bottom: 1px solid var(--light);
}

.mobile-nav-accordion a:hover {
    color: var(--gold);
    background: var(--white);
}

.mobile-nav-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ============================================================
   8. Footer
   ============================================================ */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding: var(--space-xxl) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    padding-bottom: var(--space-xxl);
}

.footer-col-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: var(--space-md);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.footer-col p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.footer-links li a {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links li a:hover {
    color: var(--gold);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-sm);
}

.footer-contact-item .icon {
    color: var(--gold);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Social Icons */
.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.social-icon:hover {
    background: var(--gold);
    color: var(--black);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-md) 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--mid-grey);
}

.footer-bottom a {
    color: var(--mid-grey);
    transition: color var(--transition);
}

.footer-bottom a:hover {
    color: var(--gold);
}

/* ============================================================
   9. Breadcrumbs
   ============================================================ */
.breadcrumbs {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--mid-grey);
    padding: var(--space-md) 0;
}

.breadcrumbs a {
    color: var(--mid-grey);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumbs a:hover {
    color: var(--gold);
}

.breadcrumbs .separator {
    color: var(--border);
    user-select: none;
}

.breadcrumbs .breadcrumb-current {
    color: var(--dark-grey);
    font-weight: 600;
}

/* ============================================================
   10. Main Content
   ============================================================ */
main#main-content {
    min-height: 60vh;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Section titles */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: var(--space-xs);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    margin-top: 8px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--mid-grey);
    margin-top: var(--space-sm);
    line-height: 1.6;
}

.section-header-split {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-xl);
    gap: var(--space-md);
}

/* ============================================================
   11. Responsive Breakpoints
   ============================================================ */

/* Tablet — 1024px */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Mobile — 768px */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .site-container {
        padding: 0 var(--space-md);
    }

    .section-header-split {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .text-4xl { font-size: 1.75rem; }
    .text-3xl { font-size: 1.5rem; }
    .text-2xl { font-size: 1.25rem; }

    :root {
        --space-xxl: 48px;
        --space-xl: 32px;
    }
}

/* Small Mobile — 480px */
@media (max-width: 480px) {
    .site-container {
        padding: 0 var(--space-sm);
    }

    .section-title {
        font-size: 1.2rem;
    }

    :root {
        --space-xxl: 40px;
        --space-xl: 24px;
        --space-lg: 16px;
    }

    .footer-social {
        flex-wrap: wrap;
    }

    .header-container {
        padding: 0 var(--space-md);
    }
}
