/* ==========================================================================
   FotoExpert Pro — Accessible 2025 palette & UX enhancements
   High-contrast · WCAG-minded · Cart always visible
   ========================================================================== */

:root {
  /* Core surfaces */
  --color-white: #ffffff;
  --color-bg: #f4f5f7;
  --color-bg-soft: #e8eaee;
  --color-surface: #ffffff;
  --color-graphite: #1e293b;
  --color-graphite-soft: #334155;
  --color-black: #0f172a;

  /* Text — stronger contrast */
  --color-text: #0f172a;
  --color-text-muted: #334155;
  --color-text-soft: #475569;
  --color-border: #cbd5e1;
  --color-border-strong: #94a3b8;

  /* Accent — deep burgundy for AA contrast with white text */
  --color-accent: #9f1239;
  --color-accent-hover: #881337;
  --color-accent-soft: rgba(159, 18, 57, 0.1);
  --color-accent-ring: rgba(159, 18, 57, 0.35);

  /* Cart — always high contrast */
  --color-cart: #0f172a;
  --color-cart-active: #9f1239;
  --color-badge: #e11d48;
  --color-badge-text: #ffffff;

  /* Semantic */
  --color-success: #047857;
  --color-success-bg: #d1fae5;
  --color-warning: #b45309;
  --color-warning-bg: #fef3c7;
  --color-info: #1d4ed8;
  --color-info-bg: #dbeafe;
  --color-danger: #b91c1c;
  --color-link: #1d4ed8;

  --shadow-accent: 0 10px 28px rgba(159, 18, 57, 0.28);
}

/* Links */
a:hover {
  color: var(--color-accent);
}

::selection {
  background: var(--color-accent);
  color: var(--color-white);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Cart icon — always visible as a filled pill button, unmistakable when active
   -------------------------------------------------------------------------- */
.icon-btn--cart {
  position: relative;
  width: auto;
  min-width: 44px;
  padding: 0 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--color-cart) !important;
  color: var(--color-white) !important;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}

.icon-btn--cart .icon {
  stroke-width: 2;
  color: var(--color-white);
}

.icon-btn--cart:hover {
  background: var(--color-graphite-soft) !important;
  color: var(--color-white) !important;
  transform: translateY(-1px);
}

.icon-btn--cart.has-items {
  background: var(--color-cart-active) !important;
  color: var(--color-white) !important;
  box-shadow: var(--shadow-accent);
}

.icon-btn--cart.has-items:hover {
  background: var(--color-accent-hover) !important;
}

.icon-btn--cart.is-animating {
  animation: cartBounce 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cartBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.28) rotate(-8deg); box-shadow: 0 0 0 10px rgba(159, 18, 57, 0.18); }
  55% { transform: scale(0.94) rotate(5deg); }
  100% { transform: scale(1) rotate(0); box-shadow: var(--shadow-accent); }
}

.badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-badge) !important;
  color: var(--color-badge-text) !important;
  border: 2px solid var(--color-white);
  min-width: 22px;
  height: 22px;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(225, 29, 72, 0.5);
  z-index: 2;
}

.header__actions .icon-btn--cart {
  display: inline-flex !important;
}

.bottom-nav__item--cart {
  color: var(--color-cart);
  position: relative;
}

.bottom-nav__item--cart .icon {
  transition: color 0.2s ease, transform 0.2s ease;
}

.bottom-nav__item--cart.has-items .icon {
  color: var(--color-cart-active);
  transform: scale(1.1);
}

.bottom-nav__item--cart .badge-count {
  top: -2px;
  right: calc(50% - 26px);
}

.bottom-nav__item--cart.is-animating .icon {
  animation: cartBounce 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Sticky cart on desktop header always present */
@media (min-width: 768px) {
  .icon-btn--cart {
    outline: 1px solid transparent;
  }
}

/* --------------------------------------------------------------------------
   Buttons — clearer primary
   -------------------------------------------------------------------------- */
.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-white);
}

.pill--sale {
  background: var(--color-badge);
}

.nav__promo {
  color: var(--color-accent) !important;
}

.topbar .icon {
  color: #fda4af;
}

/* --------------------------------------------------------------------------
   Forms — validation
   -------------------------------------------------------------------------- */
.form-row {
  position: relative;
}

.form-row.has-error input,
.form-row.has-error textarea {
  border-color: var(--color-danger) !important;
  background: #fef2f2;
}

.form-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-danger);
}

.form-row.has-error .form-error {
  display: block;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 576px) {
  .form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.check-legal {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 1rem 0 1.25rem;
  cursor: pointer;
}

.check-legal input {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.check-legal a {
  color: var(--color-link);
  text-decoration: underline;
}

.check-legal.has-error {
  color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   Success modal
   -------------------------------------------------------------------------- */
.modal[hidden],
.cookie-banner[hidden],
.cookie-settings[hidden],
.quickview[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  background: var(--color-white);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: modalPop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPulse 0.6s ease 0.15s both;
}

.modal__icon svg {
  width: 36px;
  height: 36px;
}

@keyframes successPulse {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal__dialog h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--color-black);
}

.modal__dialog p {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .modal__actions {
    flex-direction: row;
  }
  .modal__actions .btn {
    flex: 1;
  }
}

body.modal-open {
  overflow: hidden;
}

/* Fullscreen success modal — always frontmost, above every other overlay */
.modal--fullscreen {
  padding: 0;
  position: fixed !important;
  inset: 0 !important;
  z-index: 999 !important;
  height: 100vh;
  height: 100dvh;
}

.modal--fullscreen .modal__overlay {
  background: linear-gradient(165deg, #ffffff 0%, #f4f5f7 60%, #eef0f4 100%);
  backdrop-filter: none;
  animation: fadeIn 0.3s ease;
}

.modal--fullscreen .modal__dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.75rem;
  padding-top: calc(3rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  animation: modalPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal--fullscreen .modal__icon {
  width: 128px;
  height: 128px;
  margin-bottom: 1.75rem;
  box-shadow: 0 18px 45px rgba(16, 185, 129, 0.28);
}

.modal--fullscreen .modal__icon svg {
  width: 58px;
  height: 58px;
}

.modal--fullscreen .modal__dialog h2 {
  font-size: clamp(2.2rem, 6vw, 3.75rem);
  margin-bottom: 1.1rem;
}

.modal--fullscreen .modal__dialog p {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  max-width: 540px;
  margin-inline: auto;
  margin-bottom: 2.25rem;
}

.modal--fullscreen .modal__actions {
  width: min(100%, 460px);
  margin-top: 0.5rem;
  gap: 1rem;
}

.modal--fullscreen .modal__actions .btn {
  padding: 1rem 1.5rem;
  font-size: 1.02rem;
}

/* Order form inside the fullscreen modal keeps its own card layout instead
   of stretching edge-to-edge like the success screen. */
.modal--fullscreen .order-modal__dialog {
  width: min(100%, 560px);
  height: auto;
  max-height: calc(100% - 2rem);
  margin: auto;
  text-align: left;
  align-items: stretch;
  justify-content: flex-start;
  background: var(--color-white);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  overflow-y: auto;
}

.modal--fullscreen .order-modal__dialog h2 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

.modal--fullscreen .order-modal__dialog p {
  font-size: 1rem;
  max-width: none;
  margin-inline: 0;
  margin-bottom: 1.5rem;
}

.modal__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.modal__close:hover {
  background: var(--color-bg);
  color: var(--color-accent);
}

.modal__close--inline {
  position: absolute;
}

/* --------------------------------------------------------------------------
   Cart drawer
   -------------------------------------------------------------------------- */
.cart-drawer[hidden] {
  display: none !important;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  justify-content: flex-end;
}

.cart-drawer__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  height: 100%;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.25);
  animation: cartSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cartSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cart-drawer__head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.5rem;
}

.cart-drawer__empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--color-text-muted);
}

.cart-drawer__empty .btn {
  margin-top: 1rem;
}

.cart-drawer__item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.cart-drawer__item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--color-bg);
}

.cart-drawer__item h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.cart-drawer__qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cart-drawer__qty button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.cart-drawer__qty button:hover {
  background: var(--color-bg);
}

.cart-drawer__remove {
  color: var(--color-danger);
  font-size: 0.8rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 0.5rem;
}

.cart-drawer__foot[hidden] {
  display: none !important;
}

.cart-drawer__foot {
  padding: 1.1rem 1.5rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cart-drawer__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
}

body.cart-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .cart-drawer__panel {
    width: 100%;
  }
}

.order-modal__dialog {
  width: min(100%, 520px);
  text-align: left;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.order-modal__dialog h2 {
  font-size: 1.5rem;
}

.order-modal__dialog form .form-row {
  margin-bottom: 0.9rem;
}

/* --------------------------------------------------------------------------
   Cookie consent
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-h, 0px);
  z-index: 450;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.cookie-banner__panel {
  pointer-events: auto;
  width: min(100%, 920px);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.14);
  padding: 1.25rem 1.35rem;
  display: grid;
  gap: 1rem;
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  .cookie-banner {
    bottom: 1.25rem;
    padding-inline: 1.5rem;
  }
  .cookie-banner__panel {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
  }
}

body.has-compare .cookie-banner {
  bottom: calc(var(--bottom-nav-h, 0px) + 78px);
}

@media (min-width: 480px) {
  body.has-compare .cookie-banner {
    bottom: calc(var(--bottom-nav-h, 0px) + 56px);
  }
}

@media (min-width: 768px) {
  body.has-compare .cookie-banner {
    bottom: calc(1.25rem + 56px);
  }
}

.cookie-banner__text h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--color-black);
}

.cookie-banner__text p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.cookie-banner__text a {
  color: var(--color-link);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-banner__actions .btn {
  min-height: 44px;
  padding-inline: 1.1rem;
}

.cookie-settings {
  position: fixed;
  inset: 0;
  z-index: 460;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-settings__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: var(--color-white);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: modalPop 0.35s ease;
}

.cookie-settings__dialog h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.cookie-settings__dialog > p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}

.cookie-option h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.cookie-option p {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  line-height: 1.45;
  max-width: 32ch;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch__slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .switch__slider {
  background: var(--color-accent);
}

.switch input:checked + .switch__slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .switch__slider {
  opacity: 0.7;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Toast — refined
   -------------------------------------------------------------------------- */
.toast {
  background: var(--color-black) !important;
  border-left: 4px solid var(--color-success);
  border-radius: 12px !important;
  font-weight: 600;
}

.toast--cart {
  border-left-color: var(--color-badge);
}

/* --------------------------------------------------------------------------
   Skeleton loaders
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: skeletonShine 1.2s ease infinite;
  border-radius: 10px;
}

@keyframes skeletonShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-card {
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  background: white;
}

.skeleton-card__img {
  aspect-ratio: 1;
}

.skeleton-card__body {
  padding: 1.25rem;
  display: grid;
  gap: 0.65rem;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line--title { height: 18px; width: 70%; }
.skeleton-line--price { height: 20px; width: 40%; }
.skeleton-line--btn { height: 48px; width: 100%; margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   Page transition
   -------------------------------------------------------------------------- */
.page-fade {
  animation: pageFade 0.35s ease;
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Quick view
   -------------------------------------------------------------------------- */
.quickview__dialog {
  width: min(100%, 920px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: white;
  border-radius: 20px;
  display: grid;
  gap: 0;
  position: relative;
  z-index: 1;
  animation: modalPop 0.35s ease;
}

@media (min-width: 768px) {
  .quickview__dialog {
    grid-template-columns: 1fr 1fr;
  }
}

.quickview__media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  background: var(--color-bg);
}

.quickview__info {
  padding: 1.5rem;
}

.quickview__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15,23,42,0.12);
}

/* --------------------------------------------------------------------------
   Sticky add to cart (mobile product)
   -------------------------------------------------------------------------- */
.sticky-atc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 85;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 -8px 24px rgba(15,23,42,0.08);
  transform: translateY(110%);
  transition: transform 0.3s ease;
}

.sticky-atc.is-visible {
  transform: translateY(0);
}

.sticky-atc__price {
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
}

.sticky-atc .btn {
  flex: 1;
}

@media (min-width: 768px) {
  .sticky-atc {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Floating contact
   -------------------------------------------------------------------------- */
.float-contact {
  position: fixed;
  right: 1rem;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 4.5rem);
  z-index: 80;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  transition: transform 0.2s ease, background 0.2s ease;
}

.float-contact:hover {
  transform: scale(1.06);
  background: var(--color-accent-hover);
  color: white;
}

@media (min-width: 768px) {
  .float-contact {
    bottom: 6.5rem;
  }
}

/* --------------------------------------------------------------------------
   Compare bar
   -------------------------------------------------------------------------- */
.compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 88;
  background: var(--color-black);
  color: white;
  padding: 0.6rem 0.75rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
}

.compare-bar.is-visible {
  display: flex;
}

.compare-bar__count {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.compare-bar .btn {
  min-height: 40px;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

@media (max-width: 374px) {
  .compare-bar {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .compare-bar > div {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 480px) {
  .compare-bar {
    padding: 0.85rem 1rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    gap: 1rem;
  }
  .compare-bar__count {
    font-size: 0.9rem;
  }
  .compare-bar .btn {
    min-height: 44px;
    padding: 0 1.1rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 768px) {
  .compare-bar {
    padding-bottom: 0.85rem;
  }
}

body.has-compare .bottom-nav {
  bottom: 78px;
}

@media (min-width: 480px) {
  body.has-compare .bottom-nav {
    bottom: 56px;
  }
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.breadcrumbs__sep {
  opacity: 0.5;
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-black);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Product card actions (quick view / compare)
   -------------------------------------------------------------------------- */
.product-card__actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  margin-top: auto;
}

.product-card__actions .btn--primary {
  min-height: 44px;
  font-size: 0.8rem;
  padding-inline: 0.6rem;
}

.icon-btn--sm {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 10px;
  color: var(--color-text);
}

.icon-btn--sm:hover,
.icon-btn--sm.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.pagination__btn {
  min-width: 44px;
  height: 44px;
  padding: 0 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: white;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: all 0.15s ease;
}

.pagination__btn:hover,
.pagination__btn.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Catalog layout extras
   -------------------------------------------------------------------------- */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.catalog-toolbar__count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.sort-select {
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 0.9rem;
  background: white;
  font-weight: 600;
}

.related-grid,
.recent-grid,
.fbt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 576px) {
  .related-grid,
  .recent-grid,
  .fbt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .related-grid,
  .recent-grid,
  .fbt-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Maps */
.maps-embed {
  border: 0;
  width: 100%;
  min-height: 320px;
  border-radius: 18px;
  background: var(--color-bg);
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
}

/* Legal pages */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.legal-content p,
.legal-content li {
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-content ul {
  padding-left: 1.25rem;
  list-style: disc;
  margin-bottom: 1rem;
}

.legal-content a {
  color: var(--color-link);
  text-decoration: underline;
}

/* Blog article page */
.article {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.article > .eyebrow {
  margin-bottom: 0.5rem;
}

.article > .section__title {
  margin-bottom: 1.5rem;
}

.article__hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 2rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.article-content {
  max-width: 700px;
}

.article-content h2 {
  font-size: 1.5rem;
}

.article-content > p:first-child {
  font-size: 1.1rem;
  color: var(--color-text);
}

.blog-card--compact {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-card--compact .link-btn {
  pointer-events: none;
}

/* Loading overlay */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 600;
  background: linear-gradient(90deg, var(--color-accent), #fb7185);
  transition: width 0.3s ease;
  pointer-events: none;
}

.loading-bar.is-active {
  width: 80%;
}

.loading-bar.is-done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s ease 0.15s;
}

/* Availability contrast fix */
.availability--ok {
  color: var(--color-success);
  font-weight: 600;
}

.price {
  color: var(--color-black);
}

/* Desktop filters sticky enhancement */
@media (min-width: 768px) {
  .filters {
    border-color: var(--color-border);
  }
}
