/* ---------------------------------------------------------
   style.css — Bup online / SHOP
   editorial × high-end cosme EC
   --------------------------------------------------------- */

/* =========================================================
   1. Base
   ========================================================= */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

::selection {
  background-color: var(--blush);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter-mobile);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--gutter-tablet); }
}

@media (min-width: 1280px) {
  .container { padding-inline: var(--gutter-desktop); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   2. Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(250, 247, 244, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: var(--border-hair);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-5);
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__logo {
  display: block;
  width: auto;
  height: 36px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .brand__logo { height: 42px; }
}

.brand__tagline {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  padding-inline-start: 2px;
}

.global-nav {
  display: none;
}

@media (min-width: 1024px) {
  .global-nav {
    display: block;
  }

  .global-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  .global-nav__link {
    position: relative;
    font-size: 13px;
    color: var(--ink);
    letter-spacing: 0.04em;
    padding-block: 8px;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease);
  }

  .global-nav__link:hover {
    color: var(--accent-deep);
  }

  .global-nav__link[aria-current="page"] {
    color: var(--accent-deep);
    font-weight: 500;
  }

  .global-nav__link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 1px;
    background-color: var(--accent-deep);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-chip);
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--accent-deep);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--bg-elevated);
  background-color: var(--accent-deep);
  border-radius: var(--radius-chip);
  letter-spacing: 0;
}

.cart-count[data-empty="true"] {
  display: none;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

@media (min-width: 1024px) {
  .menu-toggle { display: none; }
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* =========================================================
   3. Hero
   ========================================================= */
.hero {
  padding-block: var(--space-9) var(--space-10);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero { padding-block: var(--space-11) var(--space-11); }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-9);
}

.breadcrumb a {
  color: inherit;
  transition: color var(--dur-fast) var(--ease);
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb__sep {
  opacity: 0.5;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
}

.hero__display {
  font-family: var(--font-en-serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero__display em {
  font-style: italic;
  color: var(--accent-deep);
}

.hero__rule {
  width: 48px;
  height: 1px;
  background-color: var(--accent);
  margin-bottom: var(--space-6);
  border: none;
}

/* =========================================================
   4. Controls Bar
   ========================================================= */
.controls {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background-color: rgba(250, 247, 244, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: var(--border-hair);
}

.controls__inner {
  min-height: var(--controls-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-chip {
  padding: 8px 18px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.filter-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.filter-chip[aria-pressed="true"] {
  color: var(--bg-elevated);
  background-color: var(--ink);
  border-color: var(--ink);
}

.controls__right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.result-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.result-count strong {
  font-family: var(--font-en-serif);
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--ink);
}

.sort-select {
  padding: 8px 36px 8px 14px;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--ink);
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%236B6560' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='1,1 5,5 9,1'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}

.sort-select:hover {
  border-color: var(--line-strong);
}

/* =========================================================
   5. Products
   ========================================================= */
.products-section {
  padding-block: var(--space-6) var(--space-7);
}

@media (min-width: 768px) {
  .products-section { padding-block: var(--space-7) var(--space-8); }
}

@media (min-width: 1280px) {
  .products-section { padding-block: var(--space-8) var(--space-9); }
}

.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-3);
  max-width: 480px;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .products {
    gap: var(--space-7) var(--space-4);
    max-width: 560px;
  }
}

@media (min-width: 1024px) {
  .products {
    gap: var(--space-8) var(--space-6);
    max-width: 614px;
  }
}

@media (min-width: 1280px) {
  .products {
    gap: var(--space-9) var(--space-7);
    max-width: 691px;
  }
}

/* ---- card ---- */
.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.product-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.product-card[hidden] {
  display: none !important;
}

.product-image {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  overflow: hidden;
  isolation: isolate;
  background-color: #F4ECE3;
}

.product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  transition: transform var(--dur-slow) var(--ease),
              filter var(--dur) var(--ease);
}

.product-image::after {
  /* layered radial highlight to add depth (avoid flat AI-look) */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 20% 18%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(80% 60% at 78% 88%, rgba(26,22,20,0.10) 0%, rgba(26,22,20,0) 60%);
  z-index: 1;
  mix-blend-mode: soft-light;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.product-card:hover .product-image img {
  transform: scale(1.04);
  filter: brightness(1.02);
}

/* product number — editorial sequential index */
.product-num {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  z-index: 2;
  font-family: var(--font-en-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bg-elevated);
  text-shadow: 0 1px 8px rgba(26,22,20,0.28);
  opacity: 0.96;
  pointer-events: none;
}

/* meta */
.product-card__category {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.product-card__title {
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: var(--text-md);
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.product-card__title-sub {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-jp-serif);
  font-weight: 400;
  font-size: var(--text-sm);
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.product-card__note {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.78em;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.product-card__lead {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink-muted);
}

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-en-serif);
  font-weight: 500;
  font-size: var(--text-xl);
  color: var(--ink);
  letter-spacing: 0;
  margin-top: var(--space-1);
}

.product-card__price-unit {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

/* ---- editorial price block (subscription style) ---- */
.product-card__price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: var(--border-hair);
}

.product-card__price-label {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: none;
}

.product-card__price-block .product-card__price {
  margin-top: 0;
  align-items: baseline;
  gap: 4px;
}

.product-card__price-currency {
  font-size: 0.7em;
  font-weight: 500;
  margin-right: 2px;
  color: var(--ink);
}

.product-card__price-unit--cycle {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.product-card__price-note {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-1);
}

.product-card__footer {
  margin-top: auto;
  padding-top: var(--space-4);
}

/* CTA — outlined / underlined editorial style */
.purchase-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
  background-color: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              transform 100ms var(--ease);
}

.purchase-btn:hover {
  color: var(--bg-elevated);
  background-color: var(--ink);
}

.purchase-btn:active {
  transform: scale(0.98);
}

/* CTA variant: with right arrow (subscription) */
.purchase-btn--cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.purchase-btn__arrow {
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}

.purchase-btn--cta:hover .purchase-btn__arrow {
  transform: translateX(4px);
}

.products-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding-block: var(--space-10);
  color: var(--ink-muted);
  font-family: var(--font-jp-serif);
  font-size: var(--text-md);
  letter-spacing: 0.06em;
}

/* =========================================================
   Sparkle field — kira-kira ornaments scattered behind sections
   ========================================================= */
.kira-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.kira {
  position: absolute;
  font-family: var(--font-sans);
  color: var(--pink-point, var(--accent));
  user-select: none;
  opacity: 0;
  text-shadow: 0 0 6px rgba(232, 155, 155, 0.22);
  animation: kiraTwinkle 4.4s var(--ease) infinite;
}

@keyframes kiraTwinkle {
  0%, 100% { opacity: 0.30; transform: scale(0.9)  rotate(0deg); }
  50%      { opacity: 0.82; transform: scale(1.12) rotate(8deg); }
}

.kira--1 { top:  6%;   left:  4%;  font-size: 14px; animation-delay: 0s;    }
.kira--2 { top: 14%;   right: 8%;  font-size: 18px; animation-delay: 0.5s;  }
.kira--3 { top: 38%;   left: 10%;  font-size: 11px; animation-delay: 1.1s;  }
.kira--4 { top: 52%;   right: 14%; font-size: 16px; animation-delay: 1.7s;  }
.kira--5 { bottom: 22%; left: 22%; font-size: 13px; animation-delay: 2.3s; }
.kira--6 { bottom:  8%; right: 6%; font-size: 15px; animation-delay: 2.9s; }
.kira--7 { top: 72%;   left: 48%;  font-size: 10px; animation-delay: 3.5s;  }
.kira--8 { top: 28%;   left: 38%;  font-size: 12px; animation-delay: 0.9s;  }

/* host-section requirements (sub-section already has these in subscription.css) */
.products-section {
  position: relative;
  overflow: hidden;
}
.products-section > .container {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .kira { animation: none; opacity: 0.5; }
}

/* =========================================================
   6. Back to Top
   ========================================================= */
.back-to-top {
  padding-block: var(--space-7) var(--space-10);
  text-align: center;
  border-top: var(--border-hair);
}

.back-to-top__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: var(--text-md);
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  transition: gap var(--dur) var(--ease), color var(--dur-fast) var(--ease);
}

.back-to-top__link:hover {
  color: var(--accent-deep);
  gap: 18px;
}

.back-to-top__arrow {
  display: inline-block;
  font-style: normal;
  font-size: 1em;
  color: var(--accent-deep);
  transition: transform var(--dur) var(--ease);
}

.back-to-top__link:hover .back-to-top__arrow {
  transform: translateX(-4px);
}

.back-to-top__label {
  font-family: var(--font-jp-serif);
  font-style: normal;
  letter-spacing: 0.12em;
}

/* =========================================================
   7. Footer
   ========================================================= */
.site-footer {
  padding-block: var(--space-7) var(--space-5);
  background-color: var(--ink);
  color: var(--bg);
}

.site-footer a {
  color: inherit;
  transition: color var(--dur-fast) var(--ease);
}

.site-footer a:hover {
  color: var(--blush);
}

.site-footer__top {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
  .site-footer__top {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-9);
  }
}

.site-footer__brand {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.site-footer__logo {
  display: block;
  width: auto;
  height: 40px;
  object-fit: contain;
  /* black-on-transparent PNG → crisp white for dark footer */
  filter: invert(1);
  transition: opacity var(--dur-fast) var(--ease);
}

.site-footer__brand:hover .site-footer__logo {
  opacity: 0.78;
}

@media (min-width: 768px) {
  .site-footer__logo { height: 48px; }
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-4);
  padding-block: var(--space-6);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

.site-footer__sep {
  color: rgba(255, 255, 255, 0.25);
}

.site-footer__social {
  display: flex;
  gap: var(--space-3);
}

.site-footer__social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-chip);
  transition: border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}

.site-footer__social a:hover {
  border-color: var(--blush);
  background-color: rgba(244, 220, 208, 0.08);
}

.site-footer__social svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer__bottom {
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   8. Toast
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-7);
  transform: translate(-50%, 24px);
  z-index: 80;
  padding: 14px 22px;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  color: var(--bg-elevated);
  background-color: var(--ink);
  border-radius: var(--radius-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 10px;
  border-radius: 50%;
  background-color: var(--success);
  vertical-align: middle;
}

/* =========================================================
   9. Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .product-card {
    opacity: 1;
    transform: none;
  }
}
