/* Bookstore theme tokens, dark mode, topbar controls, a11y helpers
   Keep paths relative so assets can be served via CloudFront/CDN. */

:root {
  color-scheme: only light;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-hero-panel: #f5f7f9;
  --bg-hero-panel-end: #eef1f5;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --accent-navy: #1e3a8a;
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-hover: #d97706;
  --border-color: #e2e8f0;
  --border-strong: #e8edf2;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --green: #10b981;
  --danger: #ef4444;
  --primary: var(--accent-navy);
  --text: var(--text-main);
  --text-dark: var(--text-main);
  --bg-light: var(--bg-primary);
  --navy: var(--accent-navy);
  --topbar-bg: rgba(255, 255, 255, 0.95);
  --overlay-bg: rgba(15, 23, 42, 0.55);
  --input-bg: #f9fafb;
  --footer-bg: #0f172a;
  --footer-text: #cbd5e1;
  --focus-ring: 0 0 0 3px rgba(30, 58, 138, 0.35);
  --products-section-bg: #1a1f36;
  --product-image-bg: #f3f4f6;
  --product-image-bg-mid: #e8edf2;
  --product-btn-bg: #0f172a;
  --product-btn-bg-hover: #1e293b;
  --product-btn-text: #ffffff;
  --sticky-bar-bg: rgba(255, 255, 255, 0.96);
  --products-section-heading: #f8fafc;
  --products-section-sub: #94a3b8;
  --product-stage-bg: #f4f4f5;
  --product-stage-bg-end: #eceff3;
}

[data-theme="dark"] {
  --bg-primary: #0b1220;
  --bg-secondary: #111827;
  --bg-elevated: #1a2234;
  --bg-hero-panel: #121a2b;
  --bg-hero-panel-end: #0f172a;
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --text-inverse: #0b1220;
  --accent-navy: #93c5fd;
  --accent-blue: #60a5fa;
  --accent-gold: #fbbf24;
  --accent-hover: #f59e0b;
  --border-color: #1f2937;
  --border-strong: #243044;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
  --primary: #93c5fd;
  --text: var(--text-main);
  --text-dark: var(--text-main);
  --bg-light: var(--bg-primary);
  --navy: var(--accent-navy);
  --topbar-bg: rgba(11, 18, 32, 0.92);
  --overlay-bg: rgba(0, 0, 0, 0.72);
  --input-bg: #0f172a;
  --footer-bg: #060a12;
  --footer-text: #94a3b8;
  --focus-ring: 0 0 0 3px rgba(147, 197, 253, 0.4);
  --products-section-bg: #0b1220;
  --product-image-bg: #121a2b;
  --product-image-bg-mid: #1a2234;
  --product-btn-bg: #243044;
  --product-btn-bg-hover: #2f3d52;
  --product-btn-text: #f1f5f9;
  --sticky-bar-bg: rgba(11, 18, 32, 0.94);
  --products-section-heading: var(--text-main);
  --products-section-sub: var(--text-muted);
  --product-stage-bg: #e8eaef;
  --product-stage-bg-end: #dfe3ea;
  color-scheme: dark;
}

html {
  color-scheme: light;
}

body {
  background: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.modal-open,
body.cart-open {
  overflow: hidden;
}

.topbar {
  background: var(--topbar-bg);
  border-bottom-color: var(--border-strong);
}

.brand h1,
.hero-content h2,
.section-header h3,
.carousel-header h3,
.cart-header h3,
.modal-header h3 {
  color: var(--text-main);
}

.hero-section,
.carousel-section,
.other-books-section {
  background: var(--bg-primary);
}

.recent-products-section {
  background: var(--products-section-bg);
}

.hero-image {
  background: linear-gradient(
    180deg,
    var(--product-stage-bg, var(--bg-hero-panel)) 0%,
    var(--product-stage-bg-end, var(--bg-hero-panel-end)) 100%
  );
  border-right: 1px solid var(--border-strong);
}

.hero-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  overflow: hidden;
}

.hero-section {
  background: var(--bg-primary);
  padding: 32px 24px;
  border-radius: 0;
}

.hero-content {
  background: var(--bg-elevated);
}

html[data-theme="dark"] .hero-section {
  padding: 24px 24px 0;
  background: var(--bg-primary);
}

html[data-theme="dark"] .hero-container {
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: var(--bg-elevated);
}

html[data-theme="dark"] .hero-image {
  border-right: 1px solid var(--border-color);
  padding: 40px 32px;
}

html[data-theme="dark"] .hero-content {
  background: var(--bg-elevated);
}

html[data-theme="dark"] .hero-book-cover {
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .hero-book-cover:hover {
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.5),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

.hero-author,
.rating-text,
.section-header p,
.cart-item-title,
.empty-cart p {
  color: var(--text-muted);
}

.hero-price,
.product-price,
.cart-item-price,
#cart-total-amount,
#checkout-total-amount {
  color: var(--accent-navy);
}

.search-bar input,
.form-input,
select.form-input {
  background: var(--input-bg);
  color: var(--text-main);
  border-color: var(--border-color);
}

.search-bar input:focus,
.form-input:focus,
select.form-input:focus,
.topbar-control:focus-visible,
.theme-toggle:focus-visible,
.nav-link:focus-visible,
.cart-btn:focus-visible,
.carousel-arrow:focus-visible,
.checkout-btn:focus-visible,
.close-cart:focus-visible,
.close-modal:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-control {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 38px;
}

.theme-toggle {
  width: 42px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: inline;
}

.nav-link {
  color: var(--text-main);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

.cart-btn {
  background: linear-gradient(135deg, var(--accent-navy), var(--accent-blue));
  color: #fff;
}

.cart-sidebar {
  background: var(--bg-elevated);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

.cart-header,
.cart-footer {
  border-color: var(--border-color);
  background: var(--bg-elevated);
}

.modal-overlay {
  background: var(--overlay-bg);
}

.modal-content {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.modal-header {
  border-bottom-color: var(--border-color);
}

.checkout-legal {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main);
}

.checkout-legal a {
  color: var(--accent-blue);
}

.product-card,
.carousel-item,
.other-book-card {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-main);
}

.product-card:hover,
.carousel-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.product-image-container {
  background: linear-gradient(165deg,
      var(--product-image-bg) 0%,
      var(--product-image-bg-mid) 100%);
}

html[data-theme="dark"] .product-card {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
}

/*
 * Dark mode product catalog (grid / carousel / other books only):
 * Light “stage” behind covers — standard e‑commerce pattern (natural colors, no blend hacks).
 */
html[data-theme="dark"] .products-grid .product-image-container,
html[data-theme="dark"] .other-books-grid .product-image-container,
html[data-theme="dark"] .carousel-item .product-image-container {
  background: linear-gradient(
    180deg,
    var(--product-stage-bg) 0%,
    var(--product-stage-bg-end) 100%
  ) !important;
  box-shadow: none;
  border-bottom: 1px solid var(--border-color);
}

html[data-theme="dark"] .products-grid .floating-product .product-image-container,
html[data-theme="dark"] .carousel-track > .floating-product .product-image-container,
html[data-theme="dark"] .other-books-grid .floating-product .product-image-container {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .products-grid .product-image-container img,
html[data-theme="dark"] .other-books-grid .product-image-container img,
html[data-theme="dark"] .carousel-item .product-image-container img {
  mix-blend-mode: normal !important;
  filter: none !important;
  opacity: 1 !important;
  object-fit: contain;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 12px 16px;
}

html[data-theme="dark"] .products-grid .floating-product .product-image-container img,
html[data-theme="dark"] .carousel-track > .floating-product .product-image-container img,
html[data-theme="dark"] .other-books-grid .floating-product .product-image-container img {
  padding: 0 !important;
}

html[data-theme="dark"] .products-grid .product-placeholder,
html[data-theme="dark"] .other-books-grid .product-placeholder,
html[data-theme="dark"] .carousel-item .product-placeholder {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
  color: #64748b;
  mix-blend-mode: normal !important;
  filter: none !important;
  opacity: 1 !important;
}

.product-placeholder {
  background: linear-gradient(135deg,
      var(--product-image-bg),
      var(--product-image-bg-mid));
  color: var(--text-muted);
}

.product-title {
  color: var(--text-main);
}

.product-btn {
  background: var(--product-btn-bg);
  color: var(--product-btn-text);
  border: 1px solid transparent;
}

.product-btn:hover:not(:disabled) {
  background: var(--product-btn-bg-hover);
}

[data-theme="dark"] .product-btn {
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.recent-products-section .section-header h3 {
  color: var(--products-section-heading);
}

.recent-products-section .section-header p {
  color: var(--products-section-sub);
}

.sticky-cart-bar {
  background: var(--sticky-bar-bg);
  border-top-color: var(--border-strong);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.sticky-book-details h4,
.sticky-price {
  color: var(--text-main);
}

.sticky-book-details p {
  color: var(--text-muted);
}

[data-theme="dark"] .topbar-hamburger {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .topbar-hamburger span {
  background: var(--text-main);
}

[data-theme="dark"] .topbar-drawer.is-open {
  background: rgba(11, 18, 32, 0.98);
  border-bottom-color: var(--border-strong);
}

.promo-banner,
.promo-container {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #3b82f6 100%);
  color: #ffffff;
}

.promo-content,
.promo-content h3,
.promo-content p {
  color: #ffffff !important;
}

.promo-content p {
  color: rgba(255, 255, 255, 0.92) !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) .promo-container {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #3b82f6 100%) !important;
  border: 0;
  box-shadow: 0 16px 48px rgba(30, 58, 138, 0.18);
}

html[data-theme="dark"] .promo-container {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 48%, #1d4ed8 100%) !important;
}

.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
}

.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;
}

.intl-hint {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.45;
}

[data-theme="dark"] .search-bar-icon {
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
  }

  .search-bar {
    order: 3;
    flex: 1 1 100%;
    margin: 8px 0 0;
    max-width: none;
  }
}

/* ===== Subtle Sheen CTA (specular light-sweep) =====
   Soft glass reflection — no bounce/pulse/shake.
   Sweep once, pause ~3.5s, repeat. Hover lifts + brand glow. */
.hero-cta,
.cart-btn,
.promo-cta,
#proceed-checkout-btn,
#place-order-btn:not(:disabled),
.sticky-add-cart,
.quick-view-add-cart {
  --cta-sheen: rgba(255, 255, 255, 0.42);
  --cta-glow: rgba(245, 158, 11, 0.28);
  --cta-glow-deep: rgba(30, 58, 138, 0.35);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.28s ease,
    border-color 0.28s ease,
    opacity 0.28s ease;
}

.hero-cta::before,
.cart-btn::before,
.promo-cta::before,
#proceed-checkout-btn::before,
#place-order-btn:not(:disabled)::before,
.sticky-add-cart::before,
.quick-view-add-cart::before {
  content: "";
  display: block;
  position: absolute;
  top: -20%;
  left: 0;
  width: 45%;
  height: 140%;
  background: linear-gradient(105deg,
      transparent 0%,
      transparent 35%,
      var(--cta-sheen) 50%,
      transparent 65%,
      transparent 100%);
  transform: translateX(-160%) skewX(-18deg);
  animation: ctaSpecularSheen 5.75s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
  will-change: transform;
}

/* Keep label / arrow above the sheen */
.hero-cta,
.cart-btn,
.promo-cta,
#proceed-checkout-btn,
#place-order-btn,
.sticky-add-cart,
.quick-view-add-cart {
  z-index: 0;
}

.hero-cta::after {
  content: "→";
  position: relative;
  z-index: 2;
  font-size: 18px;
  transition: transform 0.3s ease;
}

.hero-cta:hover::after {
  transform: translateX(4px);
}

.hero-cta:hover,
.cart-btn:hover,
.promo-cta:hover,
#proceed-checkout-btn:hover,
#place-order-btn:not(:disabled):hover,
.sticky-add-cart:hover,
.quick-view-add-cart:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px var(--cta-glow-deep),
    0 0 0 1px rgba(245, 158, 11, 0.18),
    0 0 24px var(--cta-glow);
}

.hero-cta:active,
.cart-btn:active,
.promo-cta:active,
#proceed-checkout-btn:active,
#place-order-btn:not(:disabled):active,
.sticky-add-cart:active,
.quick-view-add-cart:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
}

/* 0–18%: hold · 18–38%: sweep · 38–100%: pause (~3.5s+) */
@keyframes ctaSpecularSheen {

  0%,
  18% {
    transform: translateX(-160%) skewX(-18deg);
    opacity: 0;
  }

  22% {
    opacity: 1;
  }

  38% {
    transform: translateX(280%) skewX(-18deg);
    opacity: 0.85;
  }

  42%,
  100% {
    transform: translateX(280%) skewX(-18deg);
    opacity: 0;
  }
}

[data-theme="dark"] .hero-cta,
[data-theme="dark"] .cart-btn,
[data-theme="dark"] #proceed-checkout-btn,
[data-theme="dark"] #place-order-btn:not(:disabled),
[data-theme="dark"] .sticky-add-cart,
[data-theme="dark"] .quick-view-add-cart {
  --cta-sheen: rgba(255, 248, 230, 0.38);
  --cta-glow: rgba(251, 191, 36, 0.32);
  --cta-glow-deep: rgba(96, 165, 250, 0.28);
}

[data-theme="dark"] .promo-cta {
  --cta-sheen: rgba(30, 58, 95, 0.2);
  --cta-glow: rgba(251, 191, 36, 0.25);
  --cta-glow-deep: rgba(147, 197, 253, 0.22);
}

/* No sheen on secondary outline / disabled CTAs */
.checkout-btn[style*="transparent"]::before,
#place-order-btn:disabled::before,
.hero-cta:disabled::before {
  display: none !important;
  animation: none !important;
}

#place-order-btn:disabled,
.hero-cta:disabled {
  transform: none !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {

  .hero-cta::before,
  .cart-btn::before,
  .promo-cta::before,
  #proceed-checkout-btn::before,
  #place-order-btn:not(:disabled)::before,
  .sticky-add-cart::before,
  .quick-view-add-cart::before {
    animation: none !important;
    display: none !important;
  }

  .hero-cta:hover,
  .cart-btn:hover,
  .promo-cta:hover,
  #proceed-checkout-btn:hover,
  #place-order-btn:not(:disabled):hover,
  .sticky-add-cart:hover,
  .quick-view-add-cart:hover {
    transform: none;
  }
}

/* ===== Immersive product hero =========================================
   One open composition on the page background: no outer card, image card,
   divider, or text panel. The image gets depth from light and shadow only.
   ===================================================================== */
.hero-section {
  position: relative;
  isolation: isolate;
  width: min(100%, 1440px);
  max-width: 1440px;
  min-height: clamp(620px, 76vh, 900px);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 120px) clamp(24px, 6vw, 88px);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
}

.hero-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  align-items: center;
  gap: clamp(64px, 9vw, 148px);
  min-height: inherit;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}

.hero-image {
  position: relative;
  min-width: 0;
  min-height: clamp(430px, 62vh, 720px);
  padding: clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}

/* Atmospheric spotlight, not a visible image box. */
.hero-image::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(42vw, 620px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      rgba(56, 189, 248, 0.22) 0%,
      rgba(59, 130, 246, 0.12) 31%,
      rgba(99, 102, 241, 0.05) 52%,
      transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

.hero-image::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(30vw, 430px);
  height: 46px;
  left: 50%;
  bottom: 11%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.46);
  filter: blur(28px);
  pointer-events: none;
}

.hero-media {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.hero-book-cover {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(610px, 68vh);
  margin: 0 auto;
  padding: 0;
  object-fit: contain;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 6px;
  box-shadow:
    0 42px 90px rgba(0, 0, 0, 0.42),
    0 16px 38px rgba(0, 0, 0, 0.28);
  transform: perspective(1200px) rotateY(2deg) rotateX(0.5deg);
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
}

.hero-book-cover:hover {
  transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-10px) scale(1.015);
  box-shadow:
    0 52px 110px rgba(0, 0, 0, 0.5),
    0 20px 46px rgba(14, 165, 233, 0.16);
}

.hero-placeholder {
  min-height: 440px;
  aspect-ratio: 4 / 5;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 28px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(18px);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.hero-content h2 {
  max-width: 680px;
  margin: 0 0 18px;
  color: var(--text-main);
  font-family: "Playfair Display", serif;
  font-size: clamp(3rem, 5.5vw, 5.8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-author {
  margin: 0 0 34px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.hero-rating {
  margin-bottom: 28px;
}

.hero-price {
  margin-bottom: 22px;
  color: #38bdf8 !important;
  font-size: clamp(2.7rem, 4.5vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 0 34px rgba(56, 189, 248, 0.2);
}

.hero-price::after {
  margin-left: 18px;
  padding: 6px 11px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.13);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
}

.hero-stock {
  margin-bottom: 38px;
}

.hero-cta {
  min-height: 52px;
  padding: 14px 32px;
  color: #0f172a;
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
  color: #0f172a;
  background: #f1f5f9;
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
  filter: none;
}

.hero-cta:active {
  transform: scale(1.02);
}

html[data-theme="dark"] .hero-section,
html[data-theme="dark"] .hero-container,
html[data-theme="dark"] .hero-image,
html[data-theme="dark"] .hero-content {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 1024px) {
  .hero-section {
    min-height: auto;
    padding: 64px clamp(24px, 6vw, 56px) 88px;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 48px;
    min-height: auto;
  }

  .hero-image {
    min-height: min(58vh, 590px);
    padding: 20px;
  }

  .hero-image::before {
    width: min(78vw, 600px);
  }

  .hero-image::after {
    width: min(58vw, 400px);
    bottom: 5%;
  }

  .hero-media {
    max-width: 440px;
  }

  .hero-content {
    max-width: 720px;
    margin: 0 auto;
    align-items: center;
    text-align: center;
  }

  .hero-content h2 {
    font-size: clamp(2.8rem, 8vw, 5rem);
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 36px 20px 64px;
  }

  .hero-container {
    gap: 28px;
  }

  .hero-image {
    min-height: 390px;
    padding: 8px;
  }

  .hero-book-cover {
    max-height: 390px;
    transform: none;
  }

  .hero-content h2 {
    margin-bottom: 14px;
    font-size: clamp(2.35rem, 12vw, 3.6rem);
    line-height: 1.02;
  }

  .hero-author {
    margin-bottom: 24px;
  }

  .hero-rating {
    margin-bottom: 20px;
  }

  .hero-price {
    margin-bottom: 18px;
    font-size: clamp(2.5rem, 13vw, 3.5rem);
  }

  .hero-price::after {
    margin-left: 10px;
    font-size: 0.56rem;
  }

  .hero-stock {
    margin-bottom: 28px;
  }

  .hero-cta {
    width: 100%;
    min-height: 56px;
  }
}

/* ===== Premium recent-products collection ============================= */
.recent-products-section {
  position: relative;
  margin-top: 0;
  padding: clamp(72px, 9vw, 120px) clamp(20px, 5vw, 72px);
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.07), transparent 34%),
    var(--bg-primary) !important;
}

.recent-products-section .section-container {
  width: min(100%, 1400px);
}

.recent-products-section .section-header {
  margin-bottom: clamp(36px, 5vw, 58px);
}

.recent-products-section .section-header h3 {
  margin-bottom: 10px;
  color: var(--text-main);
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.recent-products-section .section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 28px);
}

.products-grid .product-card {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  box-shadow:
    0 10px 32px rgba(2, 6, 23, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.products-grid .product-card:hover {
  transform: translateY(-7px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow:
    0 24px 54px rgba(2, 6, 23, 0.3),
    0 0 32px rgba(14, 165, 233, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.products-grid .floating-product.product-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.products-grid .floating-product.product-card:hover {
  border: 0 !important;
  box-shadow: none !important;
}

.products-grid .floating-product .product-image-container {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.products-grid .product-image-container img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  object-fit: contain;
  border-radius: 12px;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: scale(0.96);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.products-grid .product-card:hover .product-image-container img {
  transform: scale(1.015);
}

.products-grid .product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 22px 24px;
}

.products-grid .product-title {
  min-height: 2.9em;
  margin-bottom: 14px;
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
}

.products-grid .product-price {
  margin-bottom: 20px;
  color: #38bdf8;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.products-grid .product-btn {
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .products-grid .product-btn {
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .products-grid .product-btn {
  color: #ffffff;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .products-grid .product-btn:hover:not(:disabled) {
  color: #0f172a;
  background: #f1f5f9;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

html:not([data-theme="dark"]) .products-grid .product-btn:hover:not(:disabled) {
  color: #ffffff;
  background: #1e293b;
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.products-grid .product-btn:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

html:not([data-theme="dark"]) .products-grid .product-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* product frames: borderless — shadow on image only (see end of file) */

/* ===== Compact premium footer ======================================== */
.footer {
  margin-top: 0;
  padding: clamp(52px, 6vw, 78px) clamp(22px, 5vw, 72px) 24px;
  color: #94a3b8;
  background:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.06), transparent 28%),
    #060b14 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  width: min(100%, 1400px);
}

.footer-grid {
  grid-template-columns: minmax(250px, 1.35fr) repeat(3, minmax(170px, 1fr));
  gap: clamp(32px, 5vw, 68px);
  margin-bottom: 42px;
}

.footer-brand {
  max-width: 390px;
}

.footer-brand h3 {
  margin-bottom: 13px;
  color: #f8fafc;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

.footer-brand p,
.footer-links a,
.footer-contact li {
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.7;
}

.footer-brand p {
  margin-bottom: 20px;
}

.footer-section h4 {
  margin-bottom: 18px;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.76rem;
  letter-spacing: 0.13em;
}

.footer-section h4::after,
.footer-links a::before {
  display: none;
}

.footer-links li {
  margin-bottom: 5px;
}

.footer-links a {
  min-height: 38px;
  padding: 7px 0;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-links a:hover {
  padding-left: 0;
  color: #fff;
  transform: translateX(3px);
}

.footer-contact li {
  min-height: 38px;
  margin-bottom: 8px;
}

.footer-contact .footer-icon {
  color: #64748b;
}

.footer-social {
  gap: 8px;
}

.social-icon {
  width: 42px;
  height: 42px;
  padding: 11px;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  box-shadow: none;
}

.social-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
}

.social-icon svg rect,
.social-icon svg circle {
  fill: none;
}

.social-icon .social-icon-play {
  fill: #060b14;
  stroke: none;
}

.social-icon:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: none;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-method-item {
  min-height: 36px;
  width: auto;
  padding: 7px 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  font-size: 0.7rem;
  line-height: 1.15;
}

.payment-method-item:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
  transform: none;
  box-shadow: none;
}

.payment-icon {
  font-size: 0.95rem;
}

.payment-security {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.payment-security p {
  margin: 0;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.55;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 30px;
  margin-top: 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p,
.footer-bottom-links a {
  color: #64748b;
  font-size: 0.72rem;
}

.footer-registration {
  margin-left: 10px;
  color: #475569;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
}

.footer-bottom-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.footer-bottom-links a:hover {
  color: #fff;
}

/* ===== Responsive storefront ========================================= */
@media (max-width: 1120px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .recent-products-section {
    padding: 64px 16px 76px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
  }

  .products-grid .product-card {
    border-radius: 18px;
  }

  .products-grid .product-image-container {
    margin: 9px 9px 0;
    padding: 12px;
    border-radius: 14px;
  }

  .products-grid .product-info {
    padding: 16px 14px 17px;
  }

  .products-grid .product-title {
    min-height: 2.8em;
    margin-bottom: 9px;
    font-size: 0.84rem;
  }

  .products-grid .product-price {
    margin-bottom: 14px;
    font-size: 1.15rem;
  }

  .products-grid .product-btn {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 0.64rem;
  }

  .footer {
    padding: 52px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-bottom: 34px;
  }

  .footer-brand,
  .footer-section {
    max-width: 100%;
  }

  .footer-section {
    padding-top: 0;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-registration {
    display: block;
    margin: 5px 0 0;
  }

  .footer-bottom-links {
    justify-content: flex-start;
  }

  .sticky-cart-bar {
    padding:
      10px 12px
      calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .sticky-cart-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
  }

  .sticky-book-info {
    min-width: 0;
  }

  .sticky-price {
    font-size: 1.15rem;
    text-align: right;
  }

  .sticky-actions {
    grid-column: 1 / -1;
  }

  .sticky-add-cart {
    min-height: 48px;
    border-radius: 999px;
  }

  body.has-sticky-cart {
    padding-bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .products-grid .product-card {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }

  .products-grid .product-image-container {
    aspect-ratio: 5 / 4;
    padding: 18px;
  }

  .products-grid .product-title {
    min-height: auto;
    font-size: 0.95rem;
  }

  .products-grid .product-price {
    font-size: 1.3rem;
  }
}

/* ===== Borderless floating product cards ==============================
   Intentionally no shared card surface: image, copy and CTA sit directly
   on the Recent Products section background, matching the open hero.
   ===================================================================== */
.products-grid .floating-product,
html[data-theme="dark"] .products-grid .floating-product,
html:not([data-theme="dark"]) .products-grid .floating-product {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  transform: none;
}

.products-grid .floating-product:hover {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: translateY(-6px);
}

.products-grid .floating-product .product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 4px 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.products-grid .floating-product .product-title,
.products-grid .floating-product .product-price {
  padding-inline: 2px;
}

@media (max-width: 768px) {
  .products-grid .floating-product {
    border-radius: 0 !important;
  }

  .products-grid .floating-product .product-image-container {
    margin: 0;
    padding: 0;
    border-radius: 16px;
  }

  .products-grid .floating-product .product-info {
    padding: 16px 2px 0;
  }
}

@media (max-width: 480px) {
  .products-grid .floating-product .product-image-container {
    aspect-ratio: 4 / 5;
  }
}

/* ===== Contemporary catalog system ===================================
   Editorial product tiles: intentional image canvas, no enclosing card,
   stronger type hierarchy and compact commerce actions.
   ===================================================================== */
.products-grid,
.other-books-grid {
  align-items: stretch;
}

.products-grid .floating-product,
.other-books-grid .floating-product,
.carousel-track > .floating-product,
.carousel-item .floating-product {
  display: flex;
  height: 100%;
  flex-direction: column;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}

.products-grid .floating-product:hover,
.other-books-grid .floating-product:hover,
.carousel-track > .floating-product:hover,
.carousel-item .floating-product:hover {
  transform: translateY(-5px);
  box-shadow: none !important;
}

.products-grid .floating-product .product-image-container,
.other-books-grid .floating-product .product-image-container,
.carousel-track > .floating-product .product-image-container,
.carousel-item .floating-product .product-image-container,
html[data-theme="dark"] .products-grid .floating-product .product-image-container,
html[data-theme="dark"] .other-books-grid .floating-product .product-image-container,
html[data-theme="dark"] .carousel-track > .floating-product .product-image-container,
html[data-theme="dark"] .carousel-item .floating-product .product-image-container,
html:not([data-theme="dark"]) .products-grid .floating-product .product-image-container,
html:not([data-theme="dark"]) .carousel-track > .floating-product .product-image-container {
  width: 100%;
  margin: 0;
  padding: 0 !important;
  aspect-ratio: 4 / 5;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: transform 0.35s ease;
}

.products-grid .floating-product:hover .product-image-container,
.other-books-grid .floating-product:hover .product-image-container,
.carousel-track > .floating-product:hover .product-image-container,
.carousel-item .floating-product:hover .product-image-container {
  box-shadow: none !important;
  border: 0 !important;
}

.products-grid .floating-product .product-image-container img,
.other-books-grid .floating-product .product-image-container img,
.carousel-track > .floating-product .product-image-container img,
.carousel-item .floating-product .product-image-container img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  object-fit: contain;
  background: transparent !important;
  border: 0 !important;
  border-radius: 20px;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: scale(0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.products-grid .floating-product:hover .product-image-container img,
.other-books-grid .floating-product:hover .product-image-container img,
.carousel-track > .floating-product:hover .product-image-container img,
.carousel-item .floating-product:hover .product-image-container img {
  transform: scale(1.02);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
}

.products-grid .floating-product .product-info,
.other-books-grid .floating-product .product-info,
.carousel-track > .floating-product .product-info,
.carousel-item .floating-product .product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 4px 0;
  background: transparent !important;
  border: 0 !important;
}

.products-grid .floating-product .product-title,
.other-books-grid .floating-product .product-title,
.carousel-track > .floating-product .product-title,
.carousel-item .floating-product .product-title {
  min-height: 2.8em;
  margin: 0 0 13px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.012em;
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: auto;
}

.product-actions .product-price {
  flex: 0 0 auto;
  margin: 0;
  color: #38bdf8;
  font-size: 1.28rem;
  font-weight: 850;
  line-height: 1;
}

.product-actions .product-btn {
  width: auto;
  min-width: 112px;
  min-height: 42px;
  margin: 0;
  padding: 10px 24px;
  flex: 0 1 auto;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .product-actions .product-btn {
  color: #0f172a;
  background: #ffffff;
  border: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

html:not([data-theme="dark"]) .product-actions .product-btn {
  color: #ffffff;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .product-actions .product-btn:hover:not(:disabled) {
  color: #0f172a;
  background: #f1f5f9;
  transform: scale(1.05);
}

html:not([data-theme="dark"]) .product-actions .product-btn:hover:not(:disabled) {
  color: #ffffff;
  background: #1e293b;
  transform: scale(1.05);
}

/* Carousel now uses the same open tile language as Recent Products. */
.carousel-section,
.other-books-section {
  width: min(100%, 1400px);
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(72px, 8vw, 110px) clamp(20px, 5vw, 72px);
  background: transparent;
}

.carousel-header {
  margin-bottom: 34px;
}

.carousel-header h3 {
  color: var(--text-main);
  font-size: clamp(2rem, 3.4vw, 3rem);
  letter-spacing: -0.035em;
}

.carousel-controls {
  gap: 8px;
}

.carousel-arrow {
  width: 44px;
  height: 44px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 50%;
  box-shadow: none;
}

.carousel-arrow:hover {
  color: #03131d;
  background: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.25);
}

.carousel-container {
  padding: 8px 2px 34px;
}

.carousel-track {
  gap: 24px;
}

.carousel-item {
  min-width: calc((100% - 72px) / 4);
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.carousel-item:hover {
  transform: none;
  box-shadow: none !important;
}

@media (max-width: 1100px) {
  .carousel-item {
    min-width: calc((100% - 48px) / 3);
  }
}

@media (max-width: 768px) {
  .carousel-section,
  .other-books-section {
    padding: 64px 16px 76px;
  }

  .carousel-item {
    min-width: calc((100% - 16px) / 2);
  }

  .carousel-track {
    gap: 16px;
  }

  .products-grid .floating-product .product-info,
  .other-books-grid .floating-product .product-info,
  .carousel-track > .floating-product .product-info,
  .carousel-item .floating-product .product-info {
    padding: 15px 2px 0;
  }

  .products-grid .floating-product .product-title,
  .other-books-grid .floating-product .product-title,
  .carousel-track > .floating-product .product-title,
  .carousel-item .floating-product .product-title {
    margin-bottom: 11px;
    font-size: 0.86rem;
  }

  .product-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .product-actions .product-price {
    font-size: 1.18rem;
  }

  .product-actions .product-btn {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .carousel-item {
    min-width: 86%;
  }

  .products-grid .floating-product .product-image-container,
  .other-books-grid .floating-product .product-image-container,
  .carousel-track > .floating-product .product-image-container,
  .carousel-item .floating-product .product-image-container {
    padding: 18px;
    border-radius: 18px;
  }

  .product-actions {
    align-items: center;
    flex-direction: row;
  }

  .product-actions .product-btn {
    width: auto;
    min-width: 128px;
  }
}

/* DPT collection uses the exact same tile structure as Recent Products.
   Cards are direct carousel children—no legacy wrapper/surface between them. */
.carousel-header {
  position: relative;
  justify-content: center;
  min-height: 74px;
  text-align: center;
}

.carousel-heading h3 {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.05;
}

.carousel-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.carousel-track > .floating-product {
  min-width: calc((100% - 72px) / 4);
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.carousel-track > .floating-product:hover {
  transform: translateY(-5px);
  box-shadow: none !important;
}

.carousel-track > .floating-product .product-title {
  min-height: 2.8em;
  margin: 0 0 13px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .carousel-track > .floating-product {
    min-width: calc((100% - 48px) / 3);
  }
}

@media (max-width: 768px) {
  .carousel-header {
    justify-content: flex-start;
    padding-right: 100px;
    text-align: left;
  }

  .carousel-heading h3 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .carousel-track > .floating-product {
    min-width: calc((100% - 16px) / 2);
  }

  .carousel-track > .floating-product .product-info {
    padding: 15px 2px 0;
  }
}

@media (max-width: 480px) {
  .carousel-header {
    min-height: 118px;
    padding-right: 0;
  }

  .carousel-controls {
    top: auto;
    right: auto;
    bottom: 0;
    left: 0;
    transform: none;
  }

  .carousel-track > .floating-product {
    min-width: 86%;
  }
}

/* Final dark-mode conflict reset for direct carousel cards.
   Must outrank the legacy html[data-theme=dark] .product-card rule. */
html[data-theme="dark"] .carousel-track > article.product-card.floating-product,
html[data-theme="dark"] .products-grid > article.product-card.floating-product {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .carousel-track > .floating-product .product-info,
html[data-theme="dark"] .products-grid > .floating-product .product-info,
html[data-theme="dark"] .carousel-track > .floating-product .product-actions,
html[data-theme="dark"] .products-grid > .floating-product .product-actions {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Premium Add to Cart — see block at end of file */

/* ===== Premium Add to Cart (all surfaces) ========================= */
/* Dark mode: crisp white pill on dark UI */
html[data-theme="dark"] .product-btn,
html[data-theme="dark"] .sticky-add-cart,
html[data-theme="dark"] .quick-view-add-cart,
html[data-theme="dark"] #hero-cta.hero-cta {
  color: #0f172a !important;
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12) !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

html[data-theme="dark"] .product-btn:hover:not(:disabled),
html[data-theme="dark"] .sticky-add-cart:hover:not(:disabled),
html[data-theme="dark"] .quick-view-add-cart:hover:not(:disabled),
html[data-theme="dark"] #hero-cta.hero-cta:hover:not(:disabled) {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  transform: scale(1.05) !important;
  filter: none !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14) !important;
}

/* Light mode: slate pill — high contrast on white backgrounds */
html:not([data-theme="dark"]) .product-btn,
html:not([data-theme="dark"]) .sticky-add-cart,
html:not([data-theme="dark"]) #hero-cta.hero-cta {
  color: #ffffff !important;
  background: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14) !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

html:not([data-theme="dark"]) .product-btn:hover:not(:disabled),
html:not([data-theme="dark"]) .sticky-add-cart:hover:not(:disabled),
html:not([data-theme="dark"]) #hero-cta.hero-cta:hover:not(:disabled) {
  color: #ffffff !important;
  background: #1e293b !important;
  transform: scale(1.05) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18) !important;
}

.product-btn:active:not(:disabled),
.sticky-add-cart:active:not(:disabled),
.quick-view-add-cart:active:not(:disabled),
#hero-cta.hero-cta:active:not(:disabled) {
  transform: scale(1.02) !important;
}

html[data-theme="dark"] .product-btn:disabled,
html[data-theme="dark"] .sticky-add-cart:disabled,
html[data-theme="dark"] #hero-cta.hero-cta:disabled {
  color: #64748b !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

html:not([data-theme="dark"]) .product-btn:disabled,
html:not([data-theme="dark"]) .sticky-add-cart:disabled,
html:not([data-theme="dark"]) #hero-cta.hero-cta:disabled {
  color: #94a3b8 !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.product-btn::before,
.sticky-add-cart::before,
.quick-view-add-cart::before,
#hero-cta.hero-cta::before {
  display: none !important;
  animation: none !important;
  content: none !important;
}

/* Quick view sits on a light panel — use slate for contrast */
.quick-view-details .quick-view-add-cart,
.quick-view-modal .quick-view-add-cart {
  color: #ffffff !important;
  background: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2) !important;
}

.quick-view-details .quick-view-add-cart:hover:not(:disabled),
.quick-view-modal .quick-view-add-cart:hover:not(:disabled) {
  color: #ffffff !important;
  background: #1e293b !important;
  transform: scale(1.05) !important;
}

[data-theme="dark"] .hero-cta,
[data-theme="dark"] .sticky-add-cart,
[data-theme="dark"] .quick-view-add-cart {
  --cta-sheen: transparent;
  --cta-glow: transparent;
  --cta-glow-deep: transparent;
}

/* Shopping cart — light item cards need dark text (sidebar inherits --text-main) */
.cart-sidebar .cart-header {
  background: #0f172a !important;
  color: #ffffff !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.cart-sidebar .cart-header h3 {
  color: #ffffff !important;
}

.cart-sidebar .close-cart {
  color: #ffffff !important;
}

.cart-sidebar .cart-item {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.cart-sidebar .cart-item-details h4 {
  color: #0f172a !important;
}

.cart-sidebar .cart-item-price {
  color: #1d4ed8 !important;
}

.cart-sidebar .qty-value {
  color: #0f172a !important;
  font-weight: 700;
}

.cart-sidebar .qty-btn {
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
}

.cart-sidebar .qty-btn:hover {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

.cart-sidebar .cart-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.cart-sidebar .cart-total,
.cart-sidebar .cart-total span:first-child {
  color: #0f172a !important;
}

.cart-sidebar #cart-total-amount {
  color: #1d4ed8 !important;
}

.cart-sidebar .empty-cart p {
  color: #64748b !important;
}

/* Light panels/modals — dark text (immune to dark theme --text-main on white/gray bg) */
.on-light-bg {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
}

.on-light-bg__heading {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a !important;
}

.on-light-bg__muted {
  font-size: 13px;
  color: #64748b !important;
}

.on-light-bg__price {
  color: #1d4ed8 !important;
  font-weight: 700;
}

.on-light-bg a {
  color: #1d4ed8 !important;
}

.on-light-bg a:hover {
  color: #1e40af !important;
}

.checkout-order-summary {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.checkout-items-summary {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  color: #0f172a !important;
  font-size: 14px;
}

.checkout-summary-item-title {
  color: #0f172a !important;
  flex: 1;
  min-width: 0;
}

.checkout-summary-total {
  border-top: 2px solid #e5e7eb;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-summary-total-label {
  font-weight: 700;
  font-size: 18px;
  color: #0f172a !important;
}

.checkout-summary-total-amount {
  font-weight: 900 !important;
  font-size: 24px;
}

.checkout-legal.on-light-bg {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
}

.checkout-legal-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #0f172a !important;
  cursor: pointer;
  margin-bottom: 10px;
}

.checkout-legal-label:last-child {
  margin-bottom: 0;
}

.modal-info-panel.on-light-bg {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
}

.modal-content .order-card {
  background: #f9fafb !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.modal-content .order-card h4 {
  color: #1e3a8a !important;
}

.modal-content .order-detail span {
  color: #334155 !important;
}

.modal-content .order-item {
  color: #64748b !important;
}

.modal-content .order-card strong {
  color: #0f172a !important;
}

.quick-view-modal {
  background: #ffffff !important;
  color: #0f172a !important;
}

.quick-view-modal .quick-view-title {
  color: #0f172a !important;
}

.quick-view-modal .quick-view-author {
  color: #64748b !important;
}

.quick-view-modal .quick-view-price {
  color: #1d4ed8 !important;
}

.quick-view-modal .quick-view-description {
  color: #475569 !important;
}

.quick-view-modal .quick-view-close {
  color: #64748b !important;
}

.pay-notice-card,
.pay-notice-card .pay-notice-title,
.pay-notice-card .pay-notice-body,
.pay-notice-card .pay-notice-meta {
  color: #334155 !important;
}

.pay-notice-card .pay-notice-title {
  color: #0f172a !important;
}

/* Final responsive catalog rules: two-up mobile grid and native swipe carousel. */
@media (max-width: 640px) {
  .mobile-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  .mobile-product-grid > .floating-product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .mobile-product-grid .floating-product .product-image-container {
    aspect-ratio: 4 / 5;
    padding: 0 !important;
  }

  .mobile-product-grid .floating-product .product-info {
    padding: 10px 1px 0 !important;
  }

  .mobile-product-grid .floating-product .product-title {
    min-height: 2.8em;
    margin-bottom: 7px;
    font-size: 0.75rem !important;
    line-height: 1.4;
  }

  .mobile-product-grid .product-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .mobile-product-grid .product-actions .product-price {
    margin: 0;
    font-size: 1rem !important;
  }

  .mobile-product-grid .product-actions .product-btn {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px !important;
    font-size: 0.58rem !important;
    letter-spacing: 0.045em !important;
    white-space: normal;
  }
}

.touch-carousel-container {
  overflow: visible !important;
}

.touch-carousel-track {
  display: flex;
  flex-flow: row nowrap;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  transform: none !important;
  transition: none !important;
  scrollbar-width: none;
}

.touch-carousel-track::-webkit-scrollbar {
  display: none;
}

.touch-carousel-track > .floating-product {
  flex: 0 0 calc((100% - 72px) / 4);
  width: calc((100% - 72px) / 4);
  min-width: 0 !important;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@media (max-width: 1100px) {
  .touch-carousel-track > .floating-product {
    flex-basis: calc((100% - 48px) / 3);
    width: calc((100% - 48px) / 3);
  }
}

@media (max-width: 768px) {
  .touch-carousel-track {
    gap: 12px !important;
  }

  .touch-carousel-track > .floating-product {
    flex: 0 0 75%;
    width: 75%;
    min-width: 75% !important;
  }

  .touch-carousel-track > .floating-product .product-title {
    font-size: 0.82rem;
  }

  .touch-carousel-track > .floating-product .product-btn {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.65rem;
  }
}