/* Interactive layer styles */
.section--tight { padding: 28px 0; }
.card { cursor: pointer; position: relative; transform-style: preserve-3d; will-change: transform; }
.card:focus-visible { outline: 3px solid #E8A9A2; outline-offset: 3px; }
.card.is-tilt { transition: box-shadow .2s; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(240px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, .5), transparent 65%);
}
.card.is-tilt::after { opacity: 1; }

/* Scroll-driven hero: individual transforms so they combine with the float animation */
.hero__art { --p: 0; }
.bottle--serum { translate: calc(var(--p) * -70px) calc(var(--p) * -50px); rotate: calc(var(--p) * -16deg); }
.bottle--jar { translate: calc(var(--p) * 80px) calc(var(--p) * 40px); rotate: calc(var(--p) * 10deg); }
.bottle--tube { translate: calc(var(--p) * 30px) calc(var(--p) * -90px); rotate: calc(var(--p) * 22deg); }
.blob { scale: calc(1 + var(--p) * .22); opacity: calc(1 - var(--p) * .5); }
.sparkle { translate: 0 calc(var(--p) * -60px); }

/* Reveals */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }
.rv-words .w { display: inline-block; opacity: 0; transform: translateY(.5em); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); }
.rv-words.in .w { opacity: 1; transform: none; }

/* Banners */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 34px 40px; border-radius: 30px; }
.banner > div:first-child { flex: 1 1 340px; }
.banner h2 { margin-bottom: .3em; }
.banner p { margin: 0; color: var(--muted); }
.banner--quiz { background: linear-gradient(120deg, #FBE9E2, #F6DDE3 55%, #EFE3F4); }
.banner--k { background: linear-gradient(120deg, #2F5D50, #3F7F6A 60%, #7FB08F); color: #fff; }
.banner--k h2 { color: #fff; } .banner--k p { color: #E2F0E8; }
.banner--rev { background: var(--white); box-shadow: var(--shadow); }
.banner__btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* Routine steps */
.steps-row { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; position: relative; }
.steps-row button {
  width: 168px; border: 0; cursor: pointer; background: var(--white); color: var(--plum); border-radius: 22px; padding: 20px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; position: relative; transition: transform .2s;
}
.steps-row button:hover { transform: translateY(-5px); }
.steps-row__n { position: absolute; top: 10px; inset-inline-start: 12px; font-weight: 800; color: var(--rose); font-size: .9rem; }
.steps-row__i { font-size: 2rem; }

/* Sets */
.sets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.set { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.set__i { font-size: 1.9rem; }
.set h3 { font-family: var(--head); color: var(--plum); font-size: 1.25rem; margin: 0; }
.set ul { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 6px; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.set__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.set__foot strong { color: var(--plum); font-size: 1.1rem; }

/* About */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stats li { background: var(--white); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stats strong { display: block; font-family: var(--head); font-size: 2.2rem; color: var(--rose-deep); line-height: 1.1; }
.stats span { color: var(--muted); font-size: .9rem; }

/* Footer policies */
#xPolicies a, #xPolicies button {
  display: block; padding: 4px 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: start;
}
#xPolicies button:hover, #xPolicies a:hover { color: #fff; }

/* Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(46, 34, 40, .5); backdrop-filter: blur(3px); animation: fadeIn .25s ease; }
.sheet {
  position: relative; width: min(760px, calc(100% - 32px)); max-height: 86vh; display: flex; flex-direction: column; outline: none;
  background: var(--cream); border-radius: 28px; box-shadow: var(--shadow-lg); animation: sheetUp .34s cubic-bezier(.2, .8, .2, 1);
}
.sheet__body { overflow-y: auto; padding: 26px; }
.sheet__grip { display: none; }
.sheet__close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 40px; height: 40px; }
@keyframes sheetUp { from { transform: translateY(40px) scale(.98); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* Product detail */
.pd { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; }
.pd__media { position: relative; aspect-ratio: 1; border-radius: 22px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.pd__media--photo { background: #fff; }
.pd__media .pack { width: 66%; height: 88%; }
.pd__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.pd__info h3 { font-size: 1.3rem; color: var(--plum); margin: 4px 0; font-weight: 800; }
.pd__info h4 { margin: 12px 0 2px; color: var(--rose-deep); font-size: .92rem; }
.pd__info p { margin: 0; color: var(--ink); font-size: .95rem; }
.pd__price, .pd__info .pd__price { font-size: 1.4rem; font-weight: 800; color: var(--plum); margin-top: 6px; }
.pd__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pd__rel-title { color: var(--plum); margin: 20px 0 10px; }
.pd__rel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pd__mini { border: 0; background: var(--white); color: var(--ink); border-radius: 16px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: start; font: inherit; }
.pd__mini b { font-size: .8rem; line-height: 1.4; }
.pd__mini small { color: var(--muted); }
.pd__mini-img { display: grid; place-items: center; height: 84px; border-radius: 12px; background: var(--bg); overflow: hidden; flex: none; }
.pd__mini-img .pack { height: 92%; width: 60%; }
.pd__mini-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }

/* Quiz */
.quiz { min-height: 340px; padding-top: 8px; }
.quiz h3 { font-family: var(--head); font-size: 1.6rem; color: var(--plum); margin: 6px 0 18px; }
.quiz__bar { height: 6px; background: var(--blush-2); border-radius: 9px; overflow: hidden; margin: 8px 44px 12px 0; }
[dir="rtl"] .quiz__bar { margin: 8px 0 12px 44px; }
.quiz__bar span { display: block; height: 100%; background: var(--rose); border-radius: 9px; transition: width .35s ease; }
.quiz__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.quiz__opts button {
  border: 2px solid transparent; background: var(--white); color: var(--plum); font: inherit; font-weight: 800; border-radius: 18px; padding: 18px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; animation: optIn .4s ease both; transition: border-color .15s, transform .15s;
}
.quiz__opts button:hover { border-color: var(--rose); transform: translateY(-3px); }
.quiz__opts span { font-size: 1.7rem; }
@keyframes optIn { from { opacity: 0; transform: translateY(14px); } }
.quiz__back { display: block; margin: 16px auto 0; background: none; border: 0; cursor: pointer; font: inherit; }
.quiz__add { width: 100%; margin-top: 12px; }
.quiz__note { color: var(--muted); font-size: .8rem; text-align: center; margin: 12px 0 0; }
.rec { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.rec li { animation: optIn .45s ease both; }
.rec button { width: 100%; border: 0; background: var(--white); color: var(--ink); border-radius: 16px; padding: 10px; cursor: pointer; display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; text-align: start; font: inherit; }
.rec .pd__mini-img { height: 62px; }
.rec small { display: block; color: var(--rose-deep); font-weight: 800; font-size: .76rem; }
.rec b { display: block; font-size: .9rem; line-height: 1.4; }
.rec em { font-style: normal; color: var(--muted); font-size: .78rem; }
.rec strong { color: var(--plum); font-size: .92rem; white-space: nowrap; }
.policy h3 { font-family: var(--head); color: var(--plum); font-size: 1.5rem; margin-inline-end: 44px; }
.policy p { color: var(--ink); margin: 0; }

/* K-Beauty story */
.story {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, #fff, var(--bg) 70%); transition: background .4s; color: #2E2228;
}
.story__bars { position: absolute; top: 14px; inset-inline: 14px; display: flex; gap: 4px; z-index: 3; }
.story__bars span { flex: 1; height: 4px; border-radius: 4px; background: rgba(46, 34, 40, .18); overflow: hidden; position: relative; }
.story__bars .done { background: #2E2228; }
.story__bars .on::after { content: ""; position: absolute; inset: 0; background: #2E2228; transform-origin: right; animation: bar 6.5s linear forwards; }
[dir="ltr"] .story__bars .on::after { transform-origin: left; }
@keyframes bar { from { transform: scaleX(0); } }
.story__x { position: absolute; top: 28px; inset-inline-end: 14px; z-index: 4; background: rgba(255, 255, 255, .85) !important; color: #2E2228 !important; }
.story__tap { position: absolute; top: 0; bottom: 0; width: 34%; border: 0; background: none; cursor: pointer; z-index: 2; }
.story__tap--prev { inset-inline-start: 0; } .story__tap--next { inset-inline-end: 0; }
.story__c { position: relative; max-width: 460px; animation: storyIn .5s cubic-bezier(.2, .8, .2, 1); }
.story__c small { display: block; font-weight: 800; opacity: .6; }
.story__c h3 { font-family: var(--head); font-size: clamp(2rem, 7vw, 3rem); margin: 4px 0 8px; color: #2E2228; }
.story__c p { font-size: 1.1rem; margin: 0 0 18px; }
.story__i { font-size: 5.5rem; display: block; animation: bob 3s ease-in-out infinite; }
.story__shop { position: relative; z-index: 3; }
@keyframes storyIn { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* ── Night mode ── */
[data-mode="night"] {
  --cream: #211720; --blush: #2E2029; --blush-2: #4A3340; --white: #2C1F28; --plum: #F7E6E2; --ink: #F3E8E5; --muted: #C4AFB5;
  --line: #443139; --rose: #E0A09A; --rose-deep: #EDB5AE;
}
[data-mode="night"] body { background: var(--cream); }
[data-mode="night"] .header { background: rgba(33, 23, 32, .9); }
[data-mode="night"] .brand img { mix-blend-mode: normal; background: #fff; border-radius: 12px; padding: 3px 6px; }
[data-mode="night"] .btn--dark { background: var(--rose); color: #2A1B24; }
[data-mode="night"] .chip[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: #2A1B24; }
[data-mode="night"] .footer { background: #171016; }
[data-mode="night"] .consult { background: linear-gradient(135deg, #3A2733, #52323F); }
[data-mode="night"] .section--cream { background: #281B24; }
[data-mode="night"] .btn--light { background: #fff; color: #3B2631; }
[data-mode="night"] .banner--quiz { background: linear-gradient(120deg, #3B2730, #47303F 55%, #3A2E4A); }
[data-mode="night"] .cart-bar, [data-mode="night"] .toast { background: var(--rose) !important; color: #2A1B24; }
[data-mode="night"] .badge--new { background: #F7E6E2; color: #2A1B24; }
[data-mode="night"] .card__media { filter: brightness(.94); }
[data-mode="night"] .bottle .label { color: #3B2631; }
[data-mode="night"] .branch iframe { filter: brightness(.85) saturate(.8); }
.hero, .section, .card, .header, .banner, .set, .stats li, .steps-row button { transition: background-color .5s ease, color .5s ease, opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.card { transition: background-color .5s ease, box-shadow .2s, transform .15s; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .sets { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: span 2; }
}
@media (max-width: 600px) {
  .mode-btn { min-width: 42px; }
  .section--tight { padding: 14px 0; }
  .banner { padding: 26px 20px; border-radius: 24px; }
  .banner .btn, .banner__btns { width: 100%; }
  .banner__btns .btn { width: 100%; }
  .steps-row { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-inline: -16px; padding: 4px 16px 12px; scrollbar-width: none; }
  .steps-row li { flex: none; }
  .steps-row button { width: 130px; padding: 16px 8px; }
  .sets { display: flex; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 14px; gap: 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .set { flex: none; width: 78%; scroll-snap-align: start; }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .stats strong { font-size: 1.8rem; }
  .sheet-wrap { place-items: end center; }
  .sheet { width: 100%; max-height: 90vh; border-radius: 26px 26px 0 0; animation-name: sheetUpM; }
  .sheet__grip { display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--blush-2); margin: 10px auto 0; }
  .sheet__body { padding: 16px 16px 24px; }
  @keyframes sheetUpM { from { transform: translateY(100%); } }
  .pd { grid-template-columns: 1fr; gap: 14px; }
  .pd__media { aspect-ratio: 16 / 11; }
  .pd__actions .btn { flex: 1 1 100%; }
  .quiz__opts { grid-template-columns: 1fr 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__brand { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .rv-words .w { opacity: 1 !important; transform: none !important; }
  .bottle, .blob, .sparkle { translate: none !important; rotate: none !important; scale: none !important; }
}

/* Order confirmation */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.order-done { text-align: center; padding: 34px 10px; animation: optIn .45s ease both; }
.order-done__ok { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--wa); color: #fff; font-size: 1.9rem; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(0); } }
.order-done h4 { font-family: var(--head); font-size: 1.5rem; color: var(--plum); margin: 12px 0 4px; }
.order-done p { color: var(--muted); margin: 4px 0; }
.order-done strong { display: block; font-size: 1.4rem; letter-spacing: .05em; color: var(--rose-deep); margin: 4px 0 10px; }
.form-err a { color: var(--wa); text-decoration: underline; }
.drawer .btn--wa:disabled { opacity: .7; cursor: wait; }
