/* ============================================================================
   CanavArt — Premium, customer-centric refresh (Index-compatible)
   Updated to work with the NEW layered markup:
   - Uses: .section-layer, .layer-hero, .layer-1, .layer-2
   - Uses: .modal (generic), #customPrintsModal, #productModal
   - Keeps your existing classes intact (hero, section, section-alt, etc.)
   - Removes conflicts / duplicate body backgrounds
   ============================================================================ */

/* -----------------------------
   Design tokens
------------------------------ */
:root {
    /* Premium green palette (coordinated layers) */
    --bg-0: #071A12;
    --bg-1: #0B2419;
    --bg-2: #0F2F22;
    --bg-3: #143A2A;
    --panel: rgba(18, 46, 35, .78);
    --panel-2: rgba(17, 56, 39, .72);
    --panel-3: rgba(255,255,255,.03);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.72);
    --muted-2: rgba(255,255,255,.60);
    --line: rgba(255,255,255,.07);
    --line-2: rgba(255,255,255,.12);
    /* Brand accent */
    --brand: #6DE7B7;
    --brand-2: #B5F8DF;
    /* Legacy olive (kept for identity) */
    --accent: #8aa56a;
    --accent-2: #2f6b4f;
    --radius: 18px;
    --radius-sm: 14px;
    --radius-lg: 26px;
    --max: 1160px;
    --pad: 20px;
    --shadow-sm: 0 10px 24px rgba(0,0,0,.22);
    --shadow: 0 18px 54px rgba(0,0,0,.35);
    --shadow-lg: 0 26px 70px rgba(0,0,0,.45);
    --ring: 0 0 0 4px rgba(109,231,183,.12);
    --ease: cubic-bezier(.2,.8,.2,1);
}

/* -----------------------------
   Base
------------------------------ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 800px at 20% -10%, rgba(109,231,183,.18), transparent 55%), radial-gradient(1000px 700px at 90% 10%, rgba(181,248,223,.10), transparent 55%), radial-gradient(1100px 800px at 50% 120%, rgba(20,70,50,.18), transparent 55%), linear-gradient(180deg, var(--bg-0), var(--bg-1));
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(var(--max), calc(100% - (var(--pad) * 2)));
    margin: 0 auto;
}

h1, h2, h3 {
    margin: 0 0 14px;
    line-height: 1.10;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.05rem, 3.1vw, 3.3rem);
}

h2 {
    font-size: clamp(1.6rem, 2.3vw, 2.2rem);
}

h3 {
    font-size: 1.06rem;
}

p {
    margin: 0 0 14px;
    color: var(--text);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: .92rem;
}

.kicker {
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .78rem;
    color: rgba(181,248,223,.88);
    margin-bottom: 10px;
}

ul, ol {
    margin: 0 0 14px;
}

li {
    line-height: 1.6;
}

/* -----------------------------
   Header (kept)
------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 23, 17, .78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform .25s var(--ease);
}

    .brand:hover {
        transform: translateY(-1px);
    }

.brand-mark {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 0 6px rgba(109,231,183,.10), 0 10px 26px rgba(0,0,0,.22);
}

.brand-name {
    font-weight: 800;
    letter-spacing: .02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .nav a {
        color: rgba(255,255,255,.92);
        font-size: .95rem;
        padding: 9px 12px;
        border-radius: 999px;
        transition: background .2s var(--ease), transform .2s var(--ease);
    }

        .nav a:hover {
            background: rgba(255,255,255,.06);
            transform: translateY(-1px);
        }

.nav-cta {
    border: 1px solid rgba(109,231,183,.22);
    background: rgba(109,231,183,.10);
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.nav-toggle {
    display: none;
    width: 46px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 10px;
    gap: 6px;
    transition: transform .2s var(--ease), background .2s var(--ease);
}

    .nav-toggle:hover {
        background: rgba(255,255,255,.08);
        transform: translateY(-1px);
    }

    .nav-toggle span {
        display: block;
        height: 2px;
        background: rgba(255,255,255,.86);
        border-radius: 2px;
    }

/* -----------------------------
   Buttons / pills / cards
------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.94);
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
    transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}

    .btn:hover {
        background: rgba(255,255,255,.06);
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(0,0,0,.22);
    }

    .btn:active {
        transform: translateY(0px);
    }

    .btn:focus-visible {
        outline: none;
        box-shadow: var(--ring), 0 14px 30px rgba(0,0,0,.25);
    }

.btn-primary {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #052014;
    border-color: rgba(255,255,255,.14);
}

    .btn-primary:hover {
        border-color: rgba(181,248,223,.30);
    }

.btn-ghost {
    background: transparent;
    border-color: rgba(255,255,255,.16);
}

    .btn-ghost:hover {
        background: rgba(255,255,255,.05);
        border-color: rgba(255,255,255,.22);
    }

.btn-small {
    padding: 10px 14px;
    font-size: .92rem;
}

.link-pill {
    border: 1px solid rgba(109,231,183,.20);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(109,231,183,.10);
    color: rgba(255,255,255,.92);
    box-shadow: 0 10px 24px rgba(0,0,0,.16);
    transition: transform .18s var(--ease), background .18s var(--ease);
}

    .link-pill:hover {
        background: rgba(255,255,255,.08);
        transform: translateY(-1px);
    }

.card {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.10);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

/* -----------------------------
   NEW: Section layering (matches updated Index.cshtml)
------------------------------ */
.section-layer {
    position: relative;
    overflow: clip;
    padding: clamp(56px, 6vw, 88px) 0;
    isolation: isolate;
}

    .section-layer::before {
        content: "";
        position: absolute;
        inset: -1px 0 auto 0;
        height: 42px;
        background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.28));
        pointer-events: none;
        z-index: 0;
    }

    .section-layer::after {
        content: "";
        position: absolute;
        inset: auto 0 -1px 0;
        height: 44px;
        background: linear-gradient(0deg, rgba(0,0,0,0), rgba(0,0,0,.30));
        pointer-events: none;
        z-index: 0;
    }

    .section-layer > .container {
        position: relative;
        z-index: 1;
    }

.layer-hero {
    background: radial-gradient(1200px 700px at 18% 12%, rgba(109,231,183,.14), transparent 55%), linear-gradient(180deg, rgba(7,26,18,0) 0%, rgba(7,26,18,.55) 60%, rgba(7,26,18,.90) 100%);
}

.layer-1 {
    background: radial-gradient(1200px 600px at 10% 0%, rgba(109,231,183,.12), transparent 58%), linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.layer-2 {
    background: radial-gradient(900px 500px at 90% 20%, rgba(181,248,223,.10), transparent 55%), linear-gradient(180deg, var(--bg-2), var(--bg-3));
}

/* Backward compat: keep .section / .section-alt without fighting the new layers */
.section {
    padding: 84px 0;
    background: transparent;
}

.section-alt {
    background: transparent;
    border: none;
}

/* -----------------------------
   Hero
------------------------------ */
.hero {
    padding: 84px 0 54px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.18fr .82fr;
    gap: 40px;
    align-items: center;
}

.hero-copy .lead {
    color: rgba(255,255,255,.86);
    line-height: 1.7;
    max-width: 66ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

/* In the updated markup, hero-meta is a 3-col “pill” list */
.hero-meta {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    color: rgba(255,255,255,.74);
    font-size: .96rem;
}

    .hero-meta li {
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(255,255,255,.05);
        border: 1px solid rgba(255,255,255,.10);
    }

/* Hero images */
.hero-media {
    display: grid;
    gap: 14px;
}

.hero-figure {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow-lg);
    background: var(--panel-2);
    transform: translateZ(0);
}

    .hero-figure img {
        width: 100%;
        height: 380px;
        object-fit: cover;
        transition: transform .45s var(--ease), filter .45s var(--ease);
        filter: saturate(1.05) contrast(1.02);
    }

    .hero-figure:hover img {
        transform: scale(1.03);
        filter: saturate(1.08) contrast(1.04);
    }

.hero-figure--secondary {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

    .hero-figure--secondary img {
        height: 200px;
        opacity: .96;
    }

/* -----------------------------
   Section header
------------------------------ */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

/* -----------------------------
   Product grid
------------------------------ */
.grid {
    display: grid;
    gap: 18px;
}

.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product {
    overflow: hidden;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

    .product:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
        border-color: rgba(181,248,223,.20);
    }

.product-media {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: radial-gradient(400px 260px at 30% 20%, rgba(255,255,255,.05), transparent 60%), linear-gradient(180deg, rgba(17,56,39,.86), rgba(18,46,35,.90));
}

    .product-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .35s var(--ease);
    }

.product:hover .product-media img {
    transform: scale(1.05);
}

.product-body {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.product-title {
    font-size: .98rem;
    line-height: 1.35;
    color: rgba(255,255,255,.95);
    min-height: 2.6em;
}

.price {
    margin: 0;
    font-weight: 800;
    letter-spacing: .01em;
    color: rgba(181,248,223,.95);
}

.product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

    .product-actions form {
        margin: 0;
    }

/* Empty state card */
.card.product.empty {
    border-style: dashed;
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.02);
}

/* Success alert */
.alert-success {
    background: rgba(109,231,183,.12);
    border: 1px solid rgba(109,231,183,.30);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 14px auto 18px;
    color: rgba(255,255,255,.92);
    box-shadow: var(--shadow-sm);
}

/* -----------------------------
   Custom Prints section
------------------------------ */
.custom-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 22px;
    align-items: start;
}

.custom-media img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow-sm);
    height: 540px;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.02);
}

.callouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.callout {
    padding: 16px;
}

.steps {
    padding-left: 18px;
    color: rgba(255,255,255,.84);
    line-height: 1.65;
}

.custom-actions {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.help-note {
    color: var(--muted-2);
    font-size: .92rem;
    line-height: 1.5;
    margin-top: 8px;
}

.inline-link {
    color: rgba(181,248,223,.95);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -----------------------------
   Modal system (works for BOTH: #productModal and #customPrintsModal)
------------------------------ */
.modal[aria-hidden="true"] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    width: min(980px, 96vw);
    max-height: min(86vh, 820px);
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: var(--shadow-lg);
    animation: modalIn .22s var(--ease) both;
}

@keyframes modalIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0px);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.92);
    font-size: 22px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .18s var(--ease), background .18s var(--ease);
}

    .modal-close:hover {
        background: rgba(255,255,255,.10);
        transform: translateY(-1px);
    }

    .modal-close:focus-visible {
        outline: none;
        box-shadow: var(--ring);
    }

.modal-body {
    padding: 22px;
}

/* Product modal internals (kept compatible with your existing class names) */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.modal-media {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.10);
}

    .modal-media img {
        width: 100%;
        height: 440px;
        object-fit: cover;
        display: block;
    }

.modal-info {
    padding: 6px 4px;
}

.modal-title {
    margin: 0 0 8px;
}

.modal-price {
    font-weight: 850;
    margin: 0 0 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* Custom prints form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

    .form-grid .full {
        grid-column: 1 / -1;
    }

label {
    display: block;
    font-size: .92rem;
    color: var(--muted);
    margin: 0 0 6px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.22);
    color: rgba(255,255,255,.92);
    outline: none;
    transition: box-shadow .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

    input:focus, select:focus, textarea:focus {
        border-color: rgba(181,248,223,.35);
        box-shadow: var(--ring);
        background: rgba(0,0,0,.28);
    }

.modal-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    align-items: center;
    justify-content: space-between;
}

/* -----------------------------
   Footer (kept)
------------------------------ */
.site-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 52px 0 30px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,.02));
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr .9fr .9fr;
    gap: 22px;
    align-items: start;
}

.footer-brand {
    font-weight: 850;
    letter-spacing: .02em;
    margin-bottom: 10px;
}

.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

    .footer-list a {
        color: rgba(255,255,255,.72);
        transition: color .18s var(--ease);
    }

        .footer-list a:hover {
            color: rgba(255,255,255,.92);
            text-decoration: underline;
        }

.footer-bottom {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.10);
}

/* -----------------------------
   Responsive
------------------------------ */
@media (max-width: 1060px) {
    .products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-figure img {
        height: 320px;
    }

    .custom-grid {
        grid-template-columns: 1fr;
    }

    .custom-media img {
        height: 380px;
    }

    .callouts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
    }

    .nav {
        display: none;
    }

        .nav.nav--open {
            display: flex;
            position: absolute;
            right: var(--pad);
            top: 64px;
            flex-direction: column;
            padding: 12px;
            background: rgba(10, 22, 17, .92);
            border: 1px solid rgba(255,255,255,.10);
            border-radius: 18px;
            box-shadow: var(--shadow-lg);
            min-width: 240px;
        }

            .nav.nav--open a {
                width: 100%;
            }

    .hero-meta {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-media img {
        height: 280px;
    }
}

@media (max-width: 560px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .products {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------
   Optional: keep your color swatch panel if used elsewhere
------------------------------ */
.color-swatch {
    position: fixed;
    left: 20px;
    bottom: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
    opacity: .9;
}

.chip {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(0,0,0,.28);
    transition: transform .2s var(--ease), opacity .2s var(--ease);
}

    .chip:hover {
        transform: scale(1.18);
        opacity: 1;
    }
