/* =====================================================================
   MerchX — banner carousel, category imagery, HTML editor, static pages
   Loaded after app.css.
   ===================================================================== */

/* ---- banner carousel ---------------------------------------------- */
.carousel { position: relative; overflow: hidden; background: var(--ink); }
.carousel-track { display: flex; height: 100%; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.carousel.fade .carousel-track { display: block; transition: none; }
.carousel.fade .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.carousel.fade .slide.is-active { opacity: 1; position: relative; }

.slide { flex: 0 0 100%; min-width: 100%; position: relative; display: flex; align-items: center; overflow: hidden; background: var(--ink); }
.slide .slide-bg { position: absolute; inset: 0; }
.slide .slide-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The shade is what makes the headline readable over artwork. It is a
   directional gradient, densest behind the text, so the image still shows
   on the open side. Without a background here the text sits unreadable on
   whatever the photo happens to be. */
.slide .slide-shade {
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(18,24,31,.92) 0%, rgba(18,24,31,.78) 38%,
        rgba(18,24,31,.35) 70%, rgba(18,24,31,.15) 100%);
}
.slide.pos-center .slide-shade {
    background: linear-gradient(0deg,
        rgba(18,24,31,.88) 0%, rgba(18,24,31,.55) 60%, rgba(18,24,31,.35) 100%);
}
.slide.pos-right .slide-shade {
    background: linear-gradient(270deg,
        rgba(18,24,31,.92) 0%, rgba(18,24,31,.78) 38%,
        rgba(18,24,31,.35) 70%, rgba(18,24,31,.15) 100%);
}
.slide.theme-dark .slide-shade {
    background: linear-gradient(90deg,
        rgba(247,245,242,.95) 0%, rgba(247,245,242,.82) 42%,
        rgba(247,245,242,.4) 75%, rgba(247,245,242,.1) 100%);
}
.slide-inner { display: flex; width: 100%; position: relative; z-index: 2; }
.slide-body { max-width: 620px; }

/* Backing panel: the headline sits on a surface of its own, so a light or
   busy photo behind it cannot make the text disappear. */
.slide-body.has-panel {
    background: rgba(18,24,31,.82);
    backdrop-filter: blur(6px) saturate(120%);
    padding: 28px 32px;
    border-radius: var(--radius);
    max-width: 560px;
}
.slide.theme-dark .slide-body.has-panel {
    background: rgba(247,245,242,.9);
}
@media (max-width: 720px) {
    .slide-body.has-panel { padding: 20px 22px; }
}

.slide.pos-center .slide-inner { justify-content: center; text-align: center; }
.slide.pos-center .slide-body { max-width: 720px; }
.slide.pos-right .slide-inner { justify-content: flex-end; text-align: right; }

.slide h2 {
    color: #fff; margin: 0 0 12px; letter-spacing: -.02em;
    font-size: clamp(1.6rem, 3.6vw, 2.6rem); text-wrap: balance;
}
.slide p {
    color: rgba(255,255,255,.9); margin: 0 0 20px; max-width: 52ch;
    font-size: clamp(.98rem, 1.4vw, 1.12rem);
}
.slide.pos-center p { margin-left: auto; margin-right: auto; }
.slide.pos-right p  { margin-left: auto; }
.slide.theme-dark h2 { color: var(--ink); }
.slide.theme-dark p  { color: var(--ink-2); }

.carousel-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.9); color: var(--ink); font-size: 1.1rem;
    display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.2);
    transition: background .15s, transform .15s;
}
.carousel-nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }

.carousel-dots {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 3; display: flex; gap: 8px;
}
.carousel-dots button {
    width: 30px; height: 4px; padding: 0; border: 0; border-radius: 99px; cursor: pointer;
    background: rgba(255,255,255,.45); transition: background .2s, width .2s;
}
.carousel-dots button:hover { background: rgba(255,255,255,.75); }
.carousel-dots button.is-active { background: #fff; width: 46px; }

.carousel-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--brand); z-index: 3; }

@media (max-width: 720px) {
    .carousel-nav { display: none; }
    .slide-body { max-width: 100%; }
    .slide-inner, .slide.pos-right .slide-inner, .slide.pos-center .slide-inner {
        justify-content: flex-start; text-align: left;
    }
    .slide.pos-right p, .slide.pos-center p { margin-left: 0; margin-right: 0; }
}

/* ---- category cards -------------------------------------------------
   Full-bleed image with the name set over a dark gradient. This reads
   richer than a typographic card, and it is what the artwork brief is
   written for: scenes that fill the frame and keep their subject clear
   of the lower third where the label sits.
   ------------------------------------------------------------------ */
.cat-card {
    position: relative; display: block; overflow: hidden; min-height: 190px;
    border-radius: var(--radius); background: var(--ink);
    transition: transform .18s ease, box-shadow .18s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cat-card:hover img { transform: scale(1.05); }

/* The gradient holds a solid value across the whole band the label sits
   in, then fades. A gradient that starts fading immediately leaves white
   type over whatever the photo happens to be - which is how "Packaging"
   ended up unreadable over a cream roll. */
.cat-card .shade {
    position: absolute; inset: 0;
    background: linear-gradient(0deg,
        rgba(10,16,22,.9) 0,
        rgba(10,16,22,.82) 72px,
        rgba(10,16,22,.3) 60%,
        rgba(10,16,22,.08) 100%);
}
.cat-card .label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 16px 18px; }
.cat-card .label b {
    display: block; color: #fff; font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em;
    text-shadow: 0 1px 3px rgba(10,16,22,.5);
}
.cat-card .label span { color: rgba(255,255,255,.82); font-size: .82rem; text-shadow: 0 1px 3px rgba(10,16,22,.5); }

/* Until real category artwork exists, up to three product shots stand in
   on a warm plate. They sit clear of the label band. */
.cat-card.no-image { background: var(--bg-3); }
.cat-card.no-image .shade {
    background: linear-gradient(0deg,
        rgba(10,16,22,.88) 0,
        rgba(10,16,22,.8) 68px,
        rgba(10,16,22,.05) 58%,
        transparent 100%);
}
.cat-card .thumbs { position: absolute; inset: 16px 16px 76px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-card .thumbs img { position: static; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cat-card .thumbs.one { grid-template-columns: 1fr; }
.cat-card .thumbs.two { grid-template-columns: repeat(2, 1fr); }

/* ---- HTML editor ---------------------------------------------------- */
.editor { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.editor-toolbar {
    display: flex; flex-wrap: wrap; gap: 2px; padding: 6px;
    background: var(--bg-2); border-bottom: 1px solid var(--line-2);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: sticky; top: 0; z-index: 5;
}
.editor-toolbar button {
    border: 1px solid transparent; background: none; border-radius: 5px;
    padding: 6px 9px; min-width: 32px; cursor: pointer;
    font: inherit; font-size: .86rem; line-height: 1.2; color: var(--ink-2);
}
.editor-toolbar button:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.editor-toolbar button.is-active { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }
.editor-toolbar .sep { width: 1px; margin: 4px 5px; background: var(--line); }
.editor-toolbar .spacer { flex: 1; }

.editor-area {
    min-height: 380px; max-height: 70vh; overflow-y: auto;
    padding: 20px 22px; outline: none; font-size: .96rem; line-height: 1.65;
}
.editor-area:focus { box-shadow: inset 0 0 0 2px rgba(47,141,70,.14); }
.editor-area > *:first-child { margin-top: 0; }
.editor-area h2 { font-size: 1.35rem; margin: 1.4em 0 .4em; }
.editor-area h3 { font-size: 1.12rem; margin: 1.3em 0 .4em; }
.editor-area p { margin: 0 0 1em; }
.editor-area ul, .editor-area ol { margin: 0 0 1em; padding-left: 24px; }
.editor-area blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 3px solid var(--brand); background: var(--bg-2); color: var(--ink-2); }
.editor-area img { max-width: 100%; height: auto; border-radius: 6px; }
.editor-area table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.editor-area th, .editor-area td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); }

.editor-source {
    display: none; width: 100%; min-height: 380px; max-height: 70vh;
    border: 0; padding: 16px 18px; resize: vertical;
    font-family: var(--mono); font-size: .84rem; line-height: 1.6;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.editor.source-mode .editor-area { display: none; }
.editor.source-mode .editor-source { display: block; }

.editor-foot {
    display: flex; flex-wrap: wrap; gap: 14px;
    padding: 7px 12px; background: var(--bg-2); border-top: 1px solid var(--line-2);
    font-size: .8rem; color: var(--ink-3);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ---- modal (link and image pickers) --------------------------------- */
.mx-modal { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 20px; background: rgba(16,32,43,.55); }
.mx-modal.open { display: grid; }
.mx-modal-box { width: 100%; max-width: 640px; max-height: 82vh; overflow-y: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.mx-modal-head { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.mx-modal-head h3 { margin: 0; font-size: 1.05rem; }
.mx-modal-body { padding: 20px; }
.mx-modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; background: var(--bg-2); border-top: 1px solid var(--line-2); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.media-grid button { aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer; background: var(--bg-3); border: 2px solid transparent; border-radius: 8px; }
.media-grid button:hover { border-color: var(--brand); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- rendered static page ------------------------------------------- */
.page-body { font-size: 1.02rem; line-height: 1.75; }
.page-body h2 { font-size: 1.5rem; margin: 1.8em 0 .5em; }
.page-body h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
.page-body p { margin: 0 0 1.15em; }
.page-body ul, .page-body ol { margin: 0 0 1.15em; padding-left: 26px; }
.page-body li { margin-bottom: .35em; }
.page-body img { border-radius: var(--radius); margin: 1em 0; }
.page-body blockquote { margin: 1.4em 0; padding: 12px 20px; border-left: 3px solid var(--brand); background: var(--bg-2); color: var(--ink-2); font-size: 1.05rem; }
.page-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .94rem; }
.page-body th, .page-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.page-body th { background: var(--bg-2); font-weight: 650; }
.page-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.page-body a { text-decoration: underline; text-underline-offset: 2px; }
.page-hero { position: relative; min-height: 260px; display: flex; align-items: flex-end; overflow: hidden; background: var(--ink); }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero .shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,16,22,.8) 0%, rgba(10,16,22,.15) 70%); }
.page-hero h1 { position: relative; z-index: 2; color: #fff; margin: 0; padding: 28px 0; }

/* Price withheld from guests: same slot, no figure. */
.product-card .price-locked { color: var(--ink-3); font-weight: 500; font-size: .88rem; }
