/* ============================================================
   KALP — Products page (Three.js floating 3D bar)
   Phase C.8. Scoped under body.kalp-shop-3d so styles only
   activate on the shop archive.

   Lifted with attribution from the designer's source at
   D:\Kalp\HOMEPAGE IDEAS\kalp_homepage_v2 (1).html.
   Nav / Why-KALP / footer-teaser sections are intentionally
   dropped — WordPress provides site chrome.
   ============================================================ */

body.kalp-shop-3d {
    background: var(--deep-brown, #1A0A03);
    color: var(--cream, #FFF8EE);
    overflow-x: hidden;
}

/* Skip any default WC archive wrappers */
body.kalp-shop-3d .site-content,
body.kalp-shop-3d .ast-container,
body.kalp-shop-3d #primary,
body.kalp-shop-3d .ast-primary-header-bar,
body.kalp-shop-3d .ast-archive-description {
    background: transparent !important;
}

/* ============================================
   HERO (the 3D bar experience)
   ============================================ */
.kalp-3d-hero {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 80px); /* leave room for sticky header */
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Initial radial-gradient bg set by JS from FLAVOURS[0].bgFrom/bgTo */
}

.kalp-3d-hero__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
}

/* Left text panel */
.kalp-3d-hero__text {
    position: relative;
    z-index: 10;
    width: 48%;
    padding: 0 56px 0 80px;
    padding-top: 80px;
}

.kalp-3d-hero__label {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: var(--gold, #C9A84C);
    opacity: 0.85;
    margin-bottom: 14px;
}

.kalp-3d-hero__city {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.6em;
    text-transform: uppercase;
    color: var(--cream, #FFF8EE);
    opacity: 0.55;
    margin-bottom: 10px;
}
/* City label removed from flavours — hide the element when empty so it leaves no gap. */
.kalp-3d-hero__city:empty { display: none; }

.kalp-3d-hero__name {
    font-family: var(--font-display, 'HP Simplified', sans-serif);
    font-size: clamp(50px, 7vw, 106px);
    font-weight: 700;
    line-height: 0.88;
    color: var(--cream, #FFF8EE);
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

.kalp-3d-hero__accent-line {
    display: block;
    height: 3px;
    width: 72px;
    margin-top: 18px;
    background: var(--gold, #C9A84C);
}

.kalp-3d-hero__tagline {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: clamp(17px, 2vw, 25px);
    font-style: italic;
    font-weight: 300;
    color: var(--cream, #FFF8EE);
    opacity: 0.82;
    line-height: 1.5;
    margin-bottom: 22px;
    max-width: 360px;
}

.kalp-3d-hero__notes {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 34px;
}

.kalp-3d-hero__note {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream, #FFF8EE);
    opacity: 0.55;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kalp-3d-hero__note::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--gold, #C9A84C);
    opacity: 0.65;
}

.kalp-3d-hero__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.kalp-3d-hero__price {
    font-family: var(--font-display, 'HP Simplified', sans-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--gold, #C9A84C);
    letter-spacing: 0.04em;
}

.kalp-3d-hero__price del { opacity: 0.5; font-weight: 400; margin-right: 6px; }
.kalp-3d-hero__price ins { text-decoration: none; }

.kalp-3d-hero__btn-primary {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--deep-brown, #1A0A03);
    background: var(--gold, #C9A84C);
    border: none;
    padding: 13px 30px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.kalp-3d-hero__btn-primary:hover {
    background: var(--gold-light, #E8C97A);
    transform: translateY(-2px);
    color: var(--deep-brown, #1A0A03);
}

.kalp-3d-hero__btn-secondary {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cream, #FFF8EE);
    background: transparent;
    border: 1px solid rgba(255, 248, 238, 0.25);
    padding: 13px 26px;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.kalp-3d-hero__btn-secondary:hover {
    border-color: rgba(255, 248, 238, 0.6);
    transform: translateY(-2px);
    color: var(--cream, #FFF8EE);
}

/* Right canvas */
.kalp-3d-hero__canvas-wrap {
    position: absolute;
    right: 0;
    top: 0;
    width: 58%;
    height: 100%;
    cursor: grab;
}
.kalp-3d-hero__canvas-wrap:active { cursor: grabbing; }

.kalp-3d-hero__canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Ingredient legend (right-side floating labels) — REMOVED per client
   (the real floating cutouts + PDP already name the ingredients). Kept the
   markup + JS harmless; hidden here across all flavours + breakpoints. */
.kalp-3d-hero__legend {
    display: none !important;
}

.kalp-3d-hero__legend-item {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 8px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 248, 238, 0.32);
    text-align: right;
    transition: color 0.6s;
}

/* Bottom UI: carousel dots */
.kalp-3d-hero__dots {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.kalp-3d-hero__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 248, 238, 0.25);
    cursor: pointer;
    transition: background 0.4s, transform 0.4s;
    border: none;
    padding: 0;
}

.kalp-3d-hero__dot.is-active {
    background: var(--gold, #C9A84C);
    transform: scale(1.4);
}

/* Bottom UI: flavour pills */
.kalp-3d-hero__pills {
    position: absolute;
    bottom: 34px;
    right: 60px;
    display: flex;
    gap: 26px;
    z-index: 20;
}

.kalp-3d-hero__pill {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 248, 238, 0.32);
    cursor: pointer;
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    transition: color 0.4s, border-color 0.4s;
    background: none;
    border-top: none; border-left: none; border-right: none;
}

/* Defeat Astra's default <button> chrome (solid blue bg + white text +
   radius on focus) so the pills stay flat gold-on-transparent text tabs.
   Chained ancestor + !important beats Astra's button / button:focus rules. */
.kalp-3d-hero .kalp-3d-hero__pill,
.kalp-3d-hero .kalp-3d-hero__pill:hover,
.kalp-3d-hero .kalp-3d-hero__pill:focus,
.kalp-3d-hero .kalp-3d-hero__pill:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom-color: transparent !important;   /* kill Astra's blue underline */
    padding: 0 0 4px 0 !important;
    color: rgba(255, 248, 238, 0.4) !important;
}

/* Hover on an inactive tab → gold text + gold underline (never blue). */
.kalp-3d-hero .kalp-3d-hero__pill:hover {
    color: var(--gold-light, #E8D293) !important;
    border-bottom-color: var(--gold-light, #E8D293) !important;
}

.kalp-3d-hero .kalp-3d-hero__pill.is-active,
.kalp-3d-hero .kalp-3d-hero__pill.is-active:hover,
.kalp-3d-hero .kalp-3d-hero__pill.is-active:focus {
    color: var(--gold, #C9A84C) !important;
    border-bottom-color: var(--gold, #C9A84C) !important;
}

/* Bottom UI: scroll hint */
.kalp-3d-hero__scroll-hint {
    position: absolute;
    bottom: 38px;
    left: 80px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.kalp-3d-hero__scroll-hint span {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 9px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 248, 238, 0.32);
}

.kalp-3d-hero__scroll-line {
    width: 38px;
    height: 1px;
    background: rgba(255, 248, 238, 0.18);
    position: relative;
    overflow: hidden;
}

.kalp-3d-hero__scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold, #C9A84C);
    animation: kalp3dScrollLine 2s ease-in-out infinite;
}

@keyframes kalp3dScrollLine {
    0%   { left: -100%; }
    100% { left: 100%; }
}

/* Swipe hint arrows (mobile) */
.kalp-3d-hero__swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    animation: kalp3dSwipeHintFade 3s ease 2s forwards;
    pointer-events: none;
}

.kalp-3d-hero__swipe-hint--left  { left: 20px; }
.kalp-3d-hero__swipe-hint--right { right: 20px; }

.kalp-3d-hero__swipe-hint svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 248, 238, 0.35);
    fill: none;
    stroke-width: 1.5;
}

.kalp-3d-hero__swipe-hint span {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 8px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 248, 238, 0.25);
    writing-mode: vertical-rl;
}

@keyframes kalp3dSwipeHintFade {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================
   RESPONSIVE — mobile stacks text below canvas
   ============================================ */
@media (max-width: 900px) {
    .kalp-3d-hero {
        flex-direction: column;
        min-height: auto;
    }
    .kalp-3d-hero__text {
        width: 100%;
        padding: 36px 26px 60px;
        order: 2;
    }
    .kalp-3d-hero__canvas-wrap {
        position: relative;
        width: 100%;
        height: 52vw;
        min-height: 280px;
        order: 1;
    }
    .kalp-3d-hero__name { font-size: clamp(42px, 13vw, 70px); }
    .kalp-3d-hero__pills,
    .kalp-3d-hero__scroll-hint,
    .kalp-3d-hero__legend { display: none; }
    .kalp-3d-hero__dots { bottom: 18px; }
    .kalp-3d-hero__swipe-hint--left  { left: 10px; }
    .kalp-3d-hero__swipe-hint--right { right: 10px; }
}

/* ============================================
   BROWSE ALL FLAVOURS — card grid below the 3D hero
   Light/cream section so it transitions from the dark hero
   into the same rainbow theme used on the rest of the site.
   ============================================ */
.kalp-shop-grid {
    background: var(--cream, #FFF8EE);
    color: var(--deep-brown, #1A0A03);
    padding: clamp(56px, 8vw, 96px) 0;
    position: relative;
    /* Subtle hairline gold border at the top to mark the transition from the
       dark hero into the cream section. */
    border-top: 1px solid rgba(201, 168, 76, 0.25);
}

.kalp-shop-grid__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.kalp-shop-grid__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 56px;
}

.kalp-shop-grid__eyebrow {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 0.72rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold-dark, #A68A3A);
    margin: 0 0 14px;
    font-weight: 600;
}

.kalp-shop-grid__title {
    font-family: var(--font-display, 'HP Simplified', sans-serif);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
    color: var(--deep-brown, #1A0A03);
    margin: 0 0 18px;
    font-weight: 600;
}

.kalp-shop-grid__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--gold-dark, #A68A3A);
    margin: 20px auto 0;
}

.kalp-shop-grid__lede {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--deep-brown, #1A0A03);
    opacity: 0.78;
    margin: 0;
}

/* Card list — 4-up on wide, 2-up on tablet, 1-up on mobile */
.kalp-shop-grid__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

@media (max-width: 1024px) {
    .kalp-shop-grid__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 560px) {
    .kalp-shop-grid__list {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}

/* Single card */
.kalp-shop-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(26, 10, 3, 0.1);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.45s var(--ease-default, cubic-bezier(0.4,0,0.2,1)),
                box-shadow 0.45s var(--ease-default, cubic-bezier(0.4,0,0.2,1)),
                border-color 0.45s var(--ease-default, cubic-bezier(0.4,0,0.2,1));
    box-shadow: 0 6px 22px rgba(26, 10, 3, 0.06);
    position: relative;
}

.kalp-shop-card:hover {
    transform: translateY(-6px);
    border-color: var(--card-accent, var(--gold-dark, #A68A3A));
    box-shadow: 0 18px 44px rgba(26, 10, 3, 0.14);
}

/* Top hairline shows the per-flavour accent on hover */
.kalp-shop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--gold-dark, #A68A3A));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.kalp-shop-card:hover::before {
    opacity: 1;
}

/* Image area — full width, aspect-locked square so all cards align */
.kalp-shop-card__image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, rgba(245, 237, 214, 0.5), rgba(255, 248, 238, 0));
    overflow: hidden;
    border-bottom: 1px solid rgba(26, 10, 3, 0.06);
}

.kalp-shop-card__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.7s ease;
}

.kalp-shop-card:hover .kalp-shop-card__image {
    transform: scale(1.04);
}

/* Body */
.kalp-shop-card__body {
    padding: 24px 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.kalp-shop-card__city {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold-dark, #A68A3A);
    margin: 0 0 10px;
    font-weight: 600;
    opacity: 0.9;
}

.kalp-shop-card__name {
    font-family: var(--font-display, 'HP Simplified', sans-serif);
    font-size: 1.45rem;
    line-height: 1.1;
    color: var(--deep-brown, #1A0A03);
    margin: 0;
    font-weight: 600;
}

.kalp-shop-card__name a {
    color: inherit !important;
    text-decoration: none !important;
}

.kalp-shop-card__name a:hover {
    color: var(--card-accent, var(--gold-dark, #A68A3A)) !important;
}

.kalp-shop-card__accent {
    display: block;
    width: 40px;
    height: 2px;
    background: var(--card-accent, var(--gold-dark, #A68A3A));
    margin: 12px 0 14px;
}

.kalp-shop-card__tagline {
    font-family: var(--font-body, 'Ubuntu', sans-serif);
    font-size: 0.92rem;
    font-style: italic;
    color: var(--deep-brown, #1A0A03);
    opacity: 0.75;
    line-height: 1.45;
    margin: 0 0 16px;
}

.kalp-shop-card__price {
    font-family: var(--font-display, 'HP Simplified', sans-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold-dark, #A68A3A);
    margin: 0 0 20px;
}

.kalp-shop-card__price del { opacity: 0.5; font-weight: 400; margin-right: 6px; font-size: 0.95rem; }
.kalp-shop-card__price ins { text-decoration: none; }

.kalp-shop-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.kalp-shop-card__btn {
    font-family: var(--font-button, 'Cinzel', serif);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 11px 18px;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
}

.kalp-shop-card__btn--primary {
    background: var(--gold, #C9A84C);
    color: var(--deep-brown, #1A0A03);
    border: 1px solid var(--gold, #C9A84C);
    font-weight: 600;
}

.kalp-shop-card__btn--primary:hover {
    background: var(--gold-dark, #A68A3A);
    color: var(--cream, #FFF8EE);
    border-color: var(--gold-dark, #A68A3A);
    transform: translateY(-1px);
}

.kalp-shop-card__btn--secondary {
    background: transparent;
    color: var(--deep-brown, #1A0A03);
    border: 1px solid rgba(26, 10, 3, 0.25);
    font-weight: 500;
}

.kalp-shop-card__btn--secondary:hover {
    border-color: var(--deep-brown, #1A0A03);
    color: var(--deep-brown, #1A0A03);
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* ============================================
   Reduced motion — disable bar bob, swipe hint, scroll line
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .kalp-3d-hero__scroll-line::after,
    .kalp-3d-hero__swipe-hint {
        animation: none;
    }
}
