:root {
  --bg: #f8f7f3;
  --text: #222222;
  --muted: #616161;
  --accent: #c67c4e;
  --card: #ffffff;
  --line: #ece7df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 247, 243, 0.96);
  backdrop-filter: blur(6px);
}

.topbar__row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-topbar__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.product-topbar__left {
  justify-self: start;
}

.product-topbar__center {
  justify-self: center;
}

.product-topbar__right {
  justify-self: end;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.brand {
  display: flex;
  align-items: center;
}

.brand__logo {
  display: inline-flex;
  width: fit-content;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  border: 1px solid #d9cebe;
  border-radius: 999px;
  padding: 3px 8px;
  color: #7f5b3b;
  background: #fffaf4;
}

.cart-button,
button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.cart-button--blink {
  animation: cart-blink 350ms ease-in-out 2;
}

@keyframes cart-blink {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.45);
  }
}

.header-socials {
  display: flex;
  gap: 6px;
}

.header-socials a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  color: #6d4b2f;
  border: 1px solid #d9cebe;
  background: #fffaf4;
}

.header-socials img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.hero {
  padding: 22px 0 8px;
}

.promo-banner {
  margin-top: 14px;
  border: 1px solid #d8c3ab;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: #fff8f0;
}

.promo-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 150px;
}

.promo-banner__content {
  padding: 16px 18px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.promo-banner__label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b5a36;
  font-weight: 700;
}

.promo-banner__content h2 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.product-page {
  padding: 20px 0 30px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.product-view,
.product-info {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.product-price {
  margin: 8px 0 12px;
}

.product-controls {
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px 0 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.card__image {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7d9be, #f1b78b);
}

.card__image--link {
  cursor: pointer;
}

.card__title {
  margin: 0;
  font-size: 1.05rem;
}

.card__title--link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #d2b89a;
  text-underline-offset: 3px;
}

.details-btn {
  width: 100%;
  background: #6f7b8c;
}

.controls {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

select,
input {
  width: 100%;
  border: 1px solid #dad4ca;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card__price {
  font-weight: 700;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 24;
}

.success-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #215a3f;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 40;
  font-size: 0.92rem;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 10px;
}

.order-modal[hidden] {
  display: none !important;
}

.order-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.order-modal__box {
  position: relative;
  width: min(560px, calc(100vw - 20px));
  max-height: min(88vh, calc(100dvh - 20px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  z-index: 1;
}

.order-modal__box h3 {
  margin: 0;
}

.order-modal__content p {
  margin: 0 0 6px;
}

.order-modal__content ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.order-modal__content li {
  overflow-wrap: anywhere;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
}

.product-modal__box {
  width: min(620px, 96vw);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.product-modal__close {
  justify-self: end;
}

.modal-gallery {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.modal-image {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1px solid var(--line);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.modal-description {
  margin: 0;
  color: var(--muted);
}

.modal-image:active {
  cursor: grabbing;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.image-viewer[hidden] {
  display: none !important;
}

.image-viewer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.image-viewer__frame {
  position: relative;
  width: min(960px, 86vw);
  height: min(86vh, 86dvh);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.04);
  z-index: 1;
}

.image-viewer__nav {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.85);
  color: #222;
}

.image-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
}

.order-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  background: #8b5a36;
}

.modal-specs {
  border: 1px dashed #d8c3ab;
  border-radius: 10px;
  padding: 10px;
  background: #fff8f0;
}

.modal-specs p {
  margin: 4px 0;
}

.delivery-box {
  border: 1px dashed #c9d9e5;
  border-radius: 10px;
  padding: 10px;
  background: #f2f8fc;
}

.delivery-box p {
  margin: 4px 0;
}

.cart-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: min(390px, 92vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ffffff;
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.2s ease;
  z-index: 25;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.cart-items {
  overflow: auto;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.93rem;
}

.cart-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.mini-candle {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d6ccbe;
  box-shadow: inset 0 0 0 2px #ffffff99;
}

.cart-item strong {
  display: block;
}

.cart-item__controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}

.remove-btn {
  background: #a63e3e;
  color: #fff;
  padding: 7px 10px;
}

.cart-footer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.checkout-form {
  display: grid;
  gap: 8px;
}

.continue-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.98rem;
  background: #8b5a36;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.upsell-box {
  border: 1px dashed #d8c3ab;
  border-radius: 10px;
  padding: 10px;
  background: #fff8f0;
  display: grid;
  gap: 8px;
}

.upsell-box p {
  margin: 0;
  font-size: 0.86rem;
}

.upsell-box button {
  padding: 8px 10px;
}

.socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.socials a {
  text-decoration: none;
  border: 0;
  color: var(--text);
  background: #fff;
  padding: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.socials a img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: block;
  object-fit: cover;
}

.socials--icons a {
  padding: 0;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  overflow: hidden;
  border: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.socials--icons img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty {
  color: var(--muted);
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
  }

  .card {
    padding: 10px;
    gap: 8px;
  }

  .cart-panel {
    width: min(420px, 100vw);
  }

  .product-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(1120px, 94vw);
  }

  .topbar__row {
    min-height: 58px;
    gap: 8px;
  }

  .product-topbar__row {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
  }

  .product-topbar__left,
  .product-topbar__center,
  .product-topbar__right {
    justify-self: auto;
  }

  .product-topbar__left {
    justify-self: start;
  }

  .product-topbar__center {
    justify-self: center;
  }

  .product-topbar__right {
    justify-self: end;
  }

  .product-topbar__row .cart-button {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  h1 {
    font-size: 0.95rem;
  }

  .hero {
    padding: 16px 0 4px;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .promo-banner {
    margin-top: 10px;
    grid-template-columns: 1fr;
  }

  .promo-banner img {
    min-height: 120px;
  }

  .cart-button,
  button {
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 0.9rem;
  }

  .topbar__actions {
    gap: 6px;
  }

  .header-socials a {
    width: 30px;
    height: 30px;
    font-size: 0.67rem;
  }

  .socials a {
    width: 40px;
    height: 40px;
  }

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

  .cart-footer {
    padding: 12px;
    gap: 10px;
  }

  .order-modal {
    padding: 8px;
  }

  .order-modal__box {
    width: min(560px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .image-viewer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding: 10px;
  }

  .image-viewer__frame {
    width: min(96vw, 640px);
    height: min(78dvh, 78vh);
    order: 1;
  }

  .image-viewer__nav {
    width: 40px;
    height: 40px;
  }

  #imageViewerPrev {
    order: 2;
    justify-self: start;
  }

  #imageViewerNext {
    order: 3;
    justify-self: end;
  }
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
