:root {
  --cream: #f6f1e8;
  --cream-deep: #ebe3d6;
  --sand: #e8dcc8;
  --bronze: #9a7848;
  --bronze-deep: #6f5432;
  --ink: #3d3228;
  --muted: #7a6b5c;
  --rose: #d4a5b5;
  --rose-soft: #e8c9d4;
  --line: rgba(111, 84, 50, 0.18);
  --white: #fffcf7;
  --shadow: 0 18px 50px rgba(61, 50, 40, 0.12);
  --radius: 18px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --logo-image: url("../assets/logo.jpg");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212, 165, 181, 0.22), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(154, 120, 72, 0.12), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(246, 241, 232, 0.86);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.brand-mark {
  width: auto;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.9);
  box-shadow: 0 4px 14px rgba(111, 84, 50, 0.1);
}

.nav-desktop {
  display: none;
  gap: 1.6rem;
  margin: 0;
  justify-self: center;
}

.nav-desktop a,
.nav-mobile a {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--bronze-deep);
}

.nav-desktop a:hover,
.nav-mobile a:hover {
  color: var(--bronze);
}

.nav-desktop a.is-active,
.nav-mobile a.is-active {
  color: var(--bronze);
  font-weight: 600;
  border-bottom: 1px solid rgba(154, 120, 72, 0.45);
  padding-bottom: 0.1rem;
}

.page-shell {
  padding-top: 0.5rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: end;
}

.cart-btn {
  margin-left: 0;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--bronze-deep);
  background: rgba(255, 252, 247, 0.7);
  border: 1px solid var(--line);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bronze);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.nav-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  gap: 6px;
  place-content: center;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--bronze-deep);
}

.nav-mobile {
  display: grid;
  gap: 0.8rem;
  padding: 0.4rem 1rem 1rem;
  border-top: 1px solid var(--line);
}

.nav-mobile[hidden] {
  display: none;
}

.hero {
  position: relative;
  min-height: min(100vh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  /* Espacio superior para que el logo de fondo se aprecie */
  padding-top: clamp(220px, 38vh, 420px);
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(
      180deg,
      rgba(246, 241, 232, 0.35) 0%,
      rgba(246, 241, 232, 0.08) 22%,
      rgba(246, 241, 232, 0.1) 48%,
      rgba(246, 241, 232, 0.72) 74%,
      rgba(235, 227, 214, 0.96) 100%
    ),
    var(--logo-image);
  background-position: center, center 36%;
  background-size: cover, min(520px, 46vw) auto;
  background-repeat: no-repeat;
}

.hero-content {
  width: min(720px, calc(100% - 2rem));
  text-align: center;
  padding: 1.2rem 0 3.2rem;
  animation: rise 900ms ease both;
  background: linear-gradient(
    180deg,
    rgba(246, 241, 232, 0) 0%,
    rgba(246, 241, 232, 0.75) 35%,
    rgba(246, 241, 232, 0.95) 100%
  );
}

.hero-line {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 500;
  margin: 0 0 0.55rem;
  color: var(--bronze-deep);
}

.hero-sub {
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bronze), var(--bronze-deep));
  color: var(--white);
  box-shadow: 0 10px 24px rgba(111, 84, 50, 0.25);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--bronze-deep);
  background: rgba(255, 252, 247, 0.65);
}

.btn-block {
  width: 100%;
}

.catalog,
.about,
.contact {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 1.8rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--bronze);
  margin: 0 0 0.5rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin: 0 0 0.6rem;
  color: var(--bronze-deep);
}

.section-copy {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.55;
}

.tabs,
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.tab,
.subtab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.55);
  color: var(--bronze-deep);
  font-size: 0.9rem;
}

.tab.is-active,
.subtab.is-active {
  background: var(--bronze);
  border-color: transparent;
  color: var(--white);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.product {
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: rise 500ms ease both;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-media {
  aspect-ratio: 1 / 1.05;
  background:
    linear-gradient(160deg, rgba(212, 165, 181, 0.25), rgba(232, 220, 200, 0.7));
  overflow: hidden;
  position: relative;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 280ms ease;
}

.product:hover .product-media img {
  transform: scale(1.04);
}

.cart-row-media {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  grid-row: span 2;
}

.product-body {
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.product-cat {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose);
}

.product h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
}

.product p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.price {
  font-weight: 600;
  color: var(--bronze-deep);
}

.price-block {
  display: grid;
  gap: 0.15rem;
}

.price-bs {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.cart-totals {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
}

.cart-total strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--bronze-deep);
}

.about {
  padding-top: 2rem;
}

.about-inner,
.contact-inner {
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.8), rgba(232, 201, 212, 0.22));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 2.6rem);
  text-align: center;
}

.about-inner p:last-child,
.contact-inner p {
  max-width: 40rem;
  margin: 0 auto 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 50, 40, 0.35);
  z-index: 50;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.cart-drawer.is-open {
  pointer-events: auto;
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--cream);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform 280ms ease;
}

.cart-drawer.is-open .cart-panel {
  transform: translateX(0);
}

.cart-head,
.cart-foot {
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.cart-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-head h2 {
  font-size: 1.5rem;
  margin: 0;
}

.cart-close {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bronze-deep);
}

.cart-items {
  padding: 0.8rem 1.2rem;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
}

.cart-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 0.5rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.8rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.8);
  border: 1px solid var(--line);
}

.cart-row-with-img {
  grid-template-columns: 52px 1fr;
  align-items: center;
}

.cart-row h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}

.cart-row .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--bronze-deep);
}

.cart-note {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Móvil / tablet —— */
@media (max-width: 819px) {
  .header-inner {
    width: min(1120px, calc(100% - 1.1rem));
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
    padding: 0.5rem 0;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .brand-mark {
    height: 42px;
    border-radius: 10px;
  }

  .nav-desktop {
    display: none !important;
  }

  .cart-btn,
  .nav-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  .nav-mobile {
    padding: 0.55rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
  }

  .nav-mobile a {
    display: block;
    padding: 0.75rem 0.2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .hero {
    min-height: calc(100svh - 64px);
    min-height: calc(100dvh - 64px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    place-items: unset;
    padding-top: clamp(210px, 58vw, 340px); /* deja aire para apreciar el logo */
  }

  .hero-atmosphere {
    /* Logo completo y centrado, sin que el texto lo tape */
    background-image:
      linear-gradient(
        180deg,
        rgba(246, 241, 232, 0.55) 0%,
        rgba(246, 241, 232, 0.12) 18%,
        rgba(246, 241, 232, 0.05) 42%,
        rgba(246, 241, 232, 0.55) 68%,
        rgba(246, 241, 232, 0.94) 86%,
        rgba(235, 227, 214, 0.98) 100%
      ),
      var(--logo-image);
    background-position: center, center 42%;
    background-size: cover, min(88vw, 360px) auto;
    background-repeat: no-repeat;
    transform: none;
  }

  .hero-content {
    width: min(720px, calc(100% - 1.4rem));
    margin: 0 auto;
    padding: 0.4rem 0 calc(1.35rem + env(safe-area-inset-bottom));
    background: linear-gradient(
      180deg,
      rgba(246, 241, 232, 0) 0%,
      rgba(246, 241, 232, 0.82) 28%,
      rgba(246, 241, 232, 0.96) 100%
    );
  }

  .hero-line {
    font-size: clamp(1.15rem, 4.5vw, 1.4rem);
    margin-bottom: 0.4rem;
  }

  .hero-sub {
    font-size: 0.9rem;
    margin-bottom: 1.15rem;
    max-width: 22rem;
  }

  .btn {
    min-height: 48px;
    width: min(100%, 280px);
  }

  .hero-content .btn {
    margin-top: 0.25rem;
  }

  .catalog,
  .about,
  .contact {
    width: min(1120px, calc(100% - 1.25rem));
    padding: 2.4rem 0;
  }

  .section-head {
    margin-bottom: 1.2rem;
  }

  .section-copy {
    font-size: 0.95rem;
  }

  .tabs,
  .subtabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    padding: 0.15rem 0.1rem 0.55rem;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar,
  .subtabs::-webkit-scrollbar {
    display: none;
  }

  .tab,
  .subtab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0.55rem 0.95rem;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.9rem;
  }

  .product {
    border-radius: 14px;
  }

  .product-body {
    padding: 0.75rem 0.7rem 0.85rem;
    gap: 0.3rem;
  }

  .product h3 {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .product p {
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .product-meta .btn {
    width: 100%;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }

  .price {
    font-size: 0.95rem;
  }

  .about-inner,
  .contact-inner {
    border-radius: 18px;
    padding: 1.25rem 1rem;
  }

  .cart-panel {
    width: 100%;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .cart-head,
  .cart-foot,
  .cart-items {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .qty button {
    width: 36px;
    height: 36px;
  }

  .cart-close {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: clamp(180px, 52vw, 280px);
  }

  .hero-atmosphere {
    background-size: cover, min(92vw, 320px) auto;
  }
}

/* Teléfonos bajos / landscape: prioriza ver logo + botón */
@media (max-width: 819px) and (max-height: 700px) {
  .hero {
    min-height: auto;
    padding-top: clamp(150px, 42vh, 260px);
  }

  .hero-sub {
    display: none;
  }
}

@media (min-width: 820px) {
  .nav-desktop {
    display: flex;
  }

  .nav-toggle,
  .nav-mobile {
    display: none !important;
  }

  .brand-mark {
    height: 58px;
  }

  .header-inner {
    padding: 0.75rem 0;
  }
}

@media (hover: none) {
  .product:hover {
    transform: none;
    box-shadow: none;
  }

  .product:hover .product-media img {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}
