/* Tomorrow Remembered — brand: navy #022249, teal #49b1be, orange CTA #dd6420, Quicksand */
:root {
    --navy: #022249;
    --navy-light: #0c3d54;
    --navy-mid: #002d5b;
    --teal: #49b1be;
    --teal-light: #55bdca;
    --teal-dark: #2b7bb9;
    --cta: #dd6420;
    --cta-hover: #e47035;
    --gold: #c4a265;
    --gold-light: #dfc492;
    --cream: #f2f2f2;
    --text: #333333;
    --muted: #757575;
    --white: #ffffff;
    --border: #dde3ea;
    --success: #2d6a4f;
    --danger: #9b2226;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(2, 34, 73, 0.08);
    --header-h: 64px;
    --font-display: 'Quicksand', system-ui, sans-serif;
    --font-body: 'Quicksand', system-ui, sans-serif;
    /* legacy aliases used in PHP templates */
    --accent: var(--teal);
    --accent-hover: var(--teal-dark);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--cream);
    line-height: 1.55;
    overflow-x: hidden;
}
body.nav-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }
.container { width: min(1200px, 100%); margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }

/* ── Header ── */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--teal);
    position: sticky;
    top: 0;
    z-index: 200;
    margin: 0;
    padding: 0;
    --header-offset: 56px;
}
.header-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo actions";
    align-items: center;
    gap: .5rem;
    min-height: 56px;
    padding-top: env(safe-area-inset-top, 0);
}
.header-shell .logo { grid-area: logo; }
.header-shell .header-actions { grid-area: actions; }
.header-shell .main-nav { grid-area: nav; }
.logo {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: .4rem 0;
}
.logo-img {
    height: 36px;
    width: auto;
    max-width: min(100%, 220px);
    object-fit: contain;
    object-position: left center;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.35rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.nav-toggle:hover { background: var(--navy-light); }

.nav-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-offset) 0 0 0;
    background: rgba(2, 34, 73, .45);
    z-index: 198;
    border: none;
    padding: 0;
    margin: 0;
}
.nav-backdrop:not([hidden]) { display: block; }

/* Mobile nav drawer */
.main-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-offset);
    bottom: 0;
    background: var(--white);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 199;
    box-shadow: 0 8px 24px rgba(2, 34, 73, .12);
}
.main-nav.open { display: block; }
.nav-inner {
    padding: .25rem 1rem 2rem;
}
.nav-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: .85rem 0 .25rem;
    margin: 0;
}
.main-nav a {
    display: block;
    padding: .8rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
}
.main-nav a:hover { color: var(--teal-dark); }
.nav-account {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.nav-account .btn { width: 100%; justify-content: center; min-height: 48px; }

.site-main { margin: 0; padding: 0; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.2rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    text-align: center;
    line-height: 1.2;
    min-height: 44px;
}
.btn-sm { padding: .5rem .9rem; font-size: .875rem; min-height: 38px; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn-primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-light); color: var(--white); }
.btn-gold { background: var(--cta); color: var(--white); border-color: var(--cta); }
.btn-gold:hover { background: var(--cta-hover); color: var(--white); border-color: var(--cta-hover); }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy); border-color: transparent; }
.btn-ghost:hover { color: var(--teal-dark); }

.hide-mobile { display: none !important; }

/* ── Hero ── */
.hero {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 45%, var(--navy-light) 100%);
    color: var(--white);
    padding: 2.5rem 0 3rem;
}
.hero-memories { text-align: center; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; align-items: start; }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 5.5vw, 2.75rem);
    line-height: 1.2;
    margin: 0 0 .75rem;
    font-weight: 700;
}
.hero-kicker {
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .72rem;
    font-weight: 700;
    color: var(--teal-light);
    margin: 0 0 .5rem;
}
.hero-lead { font-size: 1rem; opacity: .92; margin: 0; max-width: 36rem; }
.hero-actions { display: flex; flex-direction: column; gap: .65rem; margin-top: 1.25rem; }
.hero-actions .btn { width: 100%; }
.hero-card {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.hero-card h3 { margin: 0 0 1rem; font-family: var(--font-display); font-size: 1.15rem; }

/* ── Forms & search ── */
.search-box { display: grid; gap: .75rem; }
.search-box label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    display: block;
    margin-bottom: .25rem;
}
.search-row { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.search-box input, .search-box select, .form-control {
    width: 100%;
    padding: .8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 16px;
    background: var(--white);
    color: var(--text);
}
.search-box input:focus, .form-control:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(73,177,190,.25);
}

/* ── Sections ── */
.section { padding: 2.5rem 0; }
.section-dark { background: var(--white); }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 4vw, 2rem);
    margin: 0 0 .5rem;
    color: var(--navy);
    font-weight: 700;
}
.section-sub { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }
.section-pet-memories { background: linear-gradient(180deg, #eef8f9 0%, var(--cream) 100%); }
.pet-memoriam-card { border-left: 4px solid var(--teal); }

.category-grid, .listing-grid, .stats-grid, .card-grid { display: grid; gap: 1rem; }
.category-grid { grid-template-columns: 1fr; }
.listing-grid { grid-template-columns: 1fr; }
.stats-grid { grid-template-columns: repeat(2, 1fr); }
.card-grid { grid-template-columns: 1fr; }

.cat-card, .listing-card, .stat-card, .card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.15rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.cat-card i { font-size: 1.5rem; color: var(--teal); }
.listing-card h3 { font-family: var(--font-display); margin: .4rem 0; font-size: 1.1rem; color: var(--navy); }
.listing-meta { color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.badge-featured { background: var(--teal); color: var(--white); }
.badge-pro { background: var(--navy); color: var(--white); }
.badge-sponsored { background: #fef3c7; color: #92400e; }

.listing-detail { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.listing-hero-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.listing-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.listing-sidebar { position: static; }
.enquiry-box { background: var(--white); border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.products-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.products-list li { padding: .65rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

.pagination { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.5rem; }
.pagination a, .pagination span {
    padding: .55rem .8rem;
    border-radius: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    min-width: 44px;
    text-align: center;
}
.pagination .active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Footer ── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.88); padding: 2.5rem 0 1.25rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
.footer-logo { height: 36px; width: auto; max-width: 220px; margin-bottom: .75rem; filter: brightness(0) invert(1); opacity: .95; }
.footer-tagline { opacity: .75; font-size: .9rem; margin: 0; }
.site-footer h4 { color: var(--teal-light); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.site-footer a { color: rgba(255,255,255,.82); font-size: .92rem; }
.site-footer a:hover { color: var(--teal-light); }
.footer-bottom {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .82rem;
    opacity: .75;
}

/* ── Dashboard ── */
.dash-layout { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - var(--header-h)); }
.dash-sidebar { background: var(--navy); color: var(--white); padding: 1rem; }
.dash-sidebar a {
    display: block;
    padding: .7rem .85rem;
    border-radius: 6px;
    color: rgba(255,255,255,.88);
    margin-bottom: .2rem;
    font-weight: 600;
}
.dash-sidebar a:hover, .dash-sidebar a.active { background: rgba(73,177,190,.22); color: var(--teal-light); }
.dash-content { padding: 1rem; background: #e8edf2; }
.dash-header { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--white); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.kpi-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-value { font-size: 1.4rem; font-weight: 700; color: var(--navy); font-family: var(--font-display); }
.chart-card { background: var(--white); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--white); font-size: .88rem; }
.table th, .table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #eef2f6; font-size: .72rem; text-transform: uppercase; }
.ad-card { background: #fff8f0; border: 1px solid #f5c99a; border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.alert { padding: .85rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-success { background: #d8f3dc; color: var(--success); }
.alert-error { background: #fde8e8; color: var(--danger); }

.provider-picker { position: relative; }
.provider-search-results {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
    background: var(--white); border: 1px solid var(--border); border-radius: 6px;
    box-shadow: var(--shadow); max-height: 220px; overflow-y: auto;
}
.provider-search-item {
    display: block; width: 100%; text-align: left; padding: .7rem .85rem;
    border: none; background: none; cursor: pointer; border-bottom: 1px solid var(--border);
    font: inherit; color: var(--text);
}
.provider-search-item:hover { background: #eef8f9; }
.provider-search-item span { display: block; font-size: .82rem; color: var(--muted); }
.contact-list i { color: var(--teal); margin-right: .4rem; }
.totd-featured { background: linear-gradient(135deg, #fff 0%, #eef8f9 100%); border-left: 4px solid var(--teal); }

/* Instagram feed */
.instagram-section { background: var(--white); }
.instagram-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
}
.instagram-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream);
    border: 1px solid var(--border);
}
.instagram-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}
.instagram-item:hover img { transform: scale(1.04); }
.instagram-item .ig-play {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
}
.instagram-follow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: 1.25rem;
}
.instagram-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #eef8f9, #fff);
    border-radius: var(--radius);
    border: 1px dashed var(--teal);
}

/* ── Tablet ── */
@media (min-width: 600px) {
    .logo-img { height: 40px; max-width: 260px; }
    .instagram-grid { grid-template-columns: repeat(3, 1fr); gap: .75rem; }
    .hero { padding: 3rem 0 3.5rem; }
    .hero-actions { flex-direction: row; flex-wrap: wrap; }
    .hero-actions .btn { width: auto; }
    .search-row { grid-template-columns: 1fr 1fr; }
    .search-row .btn { grid-column: 1 / -1; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .listing-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .logo-img { height: 44px; max-width: 300px; }
}

/* ── Desktop ── */
@media (min-width: 1024px) {
    .hide-mobile { display: inline-flex !important; }
    .nav-toggle { display: none; }
    .nav-backdrop { display: none !important; }
    .header-shell {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "logo nav actions";
        gap: 1rem;
        min-height: 64px;
        padding-top: 0;
    }
    .site-header { border-bottom-width: 1px; border-bottom-color: var(--border); box-shadow: 0 1px 0 rgba(2,34,73,.04); }

    .main-nav {
        display: block !important;
        position: static;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        overflow: visible;
        box-shadow: none;
        background: transparent;
    }
    .nav-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: .15rem .85rem;
        padding: 0;
    }
    .nav-section-label, .nav-account { display: none; }
    .main-nav a {
        display: inline;
        padding: .25rem 0;
        border: none;
        font-size: .82rem;
        font-weight: 600;
        color: var(--navy);
        white-space: nowrap;
    }
    .main-nav a:hover { color: var(--teal-dark); }
    .logo-img { height: 44px; max-width: 280px; }

    .hero { padding: 4rem 0 4.5rem; }
    .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; }
    .search-row { grid-template-columns: 1fr 1fr auto; }
    .search-row .btn { grid-column: auto; }
    .section { padding: 3.5rem 0; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .listing-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .listing-detail { grid-template-columns: 1fr 320px; gap: 2rem; }
    .listing-hero-grid { grid-template-columns: 1fr auto; align-items: start; }
    .listing-hero-actions { justify-content: flex-end; }
    .listing-sidebar { position: sticky; top: calc(var(--header-h) + 1rem); }
    .footer-grid { grid-template-columns: 1.5fr repeat(3, 1fr); }
    .footer-bottom { flex-direction: row; justify-content: space-between; }
    .dash-layout { grid-template-columns: 240px 1fr; }
    .dash-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .instagram-grid { grid-template-columns: repeat(6, 1fr); }
    .table-wrap { margin: 0; padding: 0; }
}
