/* site.css — Shared styles across all Luz De Luna pages */

:root {
  --bg-blue: #80a0ba;
  --bg-blue-top: #5c7a98;
  --bg-overlay-opacity: 0.97;
  --blue-dark: #5a87a8;
  --pink: #d4a5b8;
  --pink-hover: #c495a8;
  --pink-light: #f5e8ef;
  --legible-shadow:
    0 0 2px rgba(58, 100, 130, 0.7),
    0 1px 3px rgba(58, 100, 130, 0.5),
    0 2px 10px rgba(58, 100, 130, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  background-color: var(--bg-blue);
  background-image:
    url("../wild-flowers.png"),
    linear-gradient(
      180deg,
      rgb(92 122 152 / var(--bg-overlay-opacity)) 0%,
      rgb(108 140 172 / var(--bg-overlay-opacity)) 38%,
      rgb(128 160 186 / var(--bg-overlay-opacity)) 100%
    );
  background-attachment: fixed, fixed;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  width: 100%;
  padding: clamp(1.75rem, 5vh, 3rem) 1rem clamp(1rem, 3vh, 1.5rem);
}

body.nav-open,
body.modal-open,
body.welcome-open {
  overflow: hidden;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(1rem, 3vh, 1.5rem) clamp(1rem, 3vw, 1.75rem);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.menu-toggle,
.cart-toggle {
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin-right: auto;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 1.2rem;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.28s ease, opacity 0.2s ease, background 0.2s ease;
  box-shadow: 0 0 1px var(--blue-dark);
}

.menu-toggle.is-open span {
  background: #1a1a1a;
  box-shadow: none;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(40, 60, 75, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.85rem);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.85rem);
}

.nav-links a {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: clamp(0.78rem, 1.6vw, 0.9rem);
  font-weight: 400;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.03em;
  -webkit-text-stroke: 0.55px var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: var(--legible-shadow);
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

.cart-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin-left: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 1.5px rgba(58, 100, 130, 0.8))
    drop-shadow(0 1px 3px rgba(58, 100, 130, 0.45));
}

.cart-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: #fff;
  stroke-width: 1.75;
  fill: none;
  paint-order: stroke fill;
  filter: drop-shadow(0 0 1px var(--blue-dark));
}

.cart-count {
  position: absolute;
  top: -0.15rem;
  right: -0.35rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--blue-dark);
  color: #fff;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.58rem;
  font-weight: 400;
  line-height: 1rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-count.has-items {
  opacity: 1;
  transform: scale(1);
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  max-width: 52rem;
  min-width: 0;
  overflow-x: clip;
  overflow-y: visible;
}

main {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0 1rem;
  user-select: none;
}

.logo-mark {
  width: 1.45rem;
  height: 1.45rem;
  margin-bottom: -0.18rem;
  opacity: 0.95;
  overflow: visible;
  filter:
    drop-shadow(0 0 1.5px rgba(58, 100, 130, 0.8))
    drop-shadow(0 1px 3px rgba(58, 100, 130, 0.45))
    drop-shadow(0 2px 8px rgba(58, 100, 130, 0.3));
}

.logo-wordmark {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  font-weight: 400;
  color: #ffffff;
  line-height: 0.9;
  letter-spacing: 0;
  -webkit-text-stroke: 0.65px var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: var(--legible-shadow);
  margin: 0;
  white-space: nowrap;
}

.logo-wordmark .de {
  font-size: 0.62em;
  vertical-align: middle;
  padding: 0 0.02em;
}

.logo-wordmark .l-luna {
  font-family: "Pinyon Script", cursive;
  font-size: 1.14em;
  letter-spacing: -0.06em;
  margin-right: -0.11em;
  position: relative;
  top: 0.04em;
  -webkit-text-stroke: 0.65px var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: var(--legible-shadow);
}

.logo-rule {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: min(8rem, 52vw);
  margin: 0.02rem 0;
}

.logo-rule::before,
.logo-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    #fff 20%,
    #fff 80%,
    transparent
  );
  filter:
    drop-shadow(0 0 1px rgba(58, 100, 130, 0.65))
    drop-shadow(0 1px 2px rgba(58, 100, 130, 0.4));
}

.logo-rule svg {
  width: 0.35rem;
  height: 0.35rem;
  flex-shrink: 0;
  overflow: visible;
  filter:
    drop-shadow(0 0 1px rgba(58, 100, 130, 0.65))
    drop-shadow(0 1px 2px rgba(58, 100, 130, 0.4));
}

.logo-subtitle {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(0.68rem, 1.6vw, 0.8rem);
  font-weight: 400;
  font-style: normal;
  color: #ffffff;
  letter-spacing: 0.08em;
  -webkit-text-stroke: 0.55px var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: var(--legible-shadow);
  margin: 0;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: clamp(2rem, 5vh, 3rem) 0 0;
  text-align: center;
}

.site-footer p {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.03em;
  -webkit-text-stroke: 0.4px var(--blue-dark);
  paint-order: stroke fill;
  text-shadow: var(--legible-shadow);
  margin: 0;
}

.footer-made {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin-top: 0.55rem;
  transform: translateY(1px);
}

.footer-nm-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.footer-nm {
  display: block;
  height: 1.55rem;
  width: auto;
  margin: 0;
  opacity: 0.95;
  flex-shrink: 0;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.cart-drawer.is-open {
  pointer-events: auto;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-drawer.is-open .cart-backdrop {
  opacity: 1;
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(19rem, 92vw);
  height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.cart-drawer.is-open .cart-panel {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid #eeeeee;
  flex-shrink: 0;
}

.cart-header h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0;
  color: #1a1a1a;
}

.cart-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: #f5f5f5;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: #1a1a1a;
}

.cart-close:hover {
  opacity: 0.7;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.85rem;
}

.cart-empty {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.8rem;
  color: #666666;
  text-align: center;
  padding: 2.5rem 1rem;
}

.cart-empty[hidden],
.cart-items[hidden] {
  display: none;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-line-thumb {
  aspect-ratio: 1;
  border-radius: 2px;
  background-color: #f4f8fc;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #e8f2fa 0% 50%);
  background-size: 88% auto, 8px 8px;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
}

.cart-line-thumb.is-pink {
  background-color: #faf6f8;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #f5e8ef 0% 50%);
}

.cart-line-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cart-line-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.15;
}

.cart-line-variant {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.65rem;
  color: #666666;
  margin: 0;
}

.cart-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.cart-line-qty {
  display: flex;
  align-items: center;
  border: 1px solid #dddddd;
  border-radius: 3px;
  background: #ffffff;
}

.cart-line-qty button {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  color: #1a1a1a;
}

.cart-line-qty button:hover {
  background: #f5f5f5;
}

.cart-line-qty span {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  min-width: 1.1rem;
  text-align: center;
  color: #1a1a1a;
}

.cart-line-price {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #1a1a1a;
}

.cart-line-remove {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.65rem;
  color: #888888;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-align: left;
}

.cart-line-remove:hover {
  color: #1a1a1a;
}

.cart-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #eeeeee;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
  background: #ffffff;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: #1a1a1a;
}

.cart-checkout {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 3px;
  background: #5a7a92;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cart-checkout:hover {
  opacity: 0.88;
}

.cart-checkout:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  html, body {
    min-height: 100dvh;
    background-attachment: scroll, scroll;
  }

  body {
    padding:
      max(3.5rem, calc(env(safe-area-inset-top) + 3rem))
      max(0.85rem, env(safe-area-inset-right))
      max(2rem, env(safe-area-inset-bottom))
      max(0.85rem, env(safe-area-inset-left));
  }

  .site-header {
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding:
      max(0.85rem, env(safe-area-inset-top))
      max(0.85rem, env(safe-area-inset-right))
      0
      max(0.85rem, env(safe-area-inset-left));
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    pointer-events: none;
  }

  .menu-toggle {
    display: flex;
    gap: 6px;
    z-index: 160;
  }

  .menu-toggle span {
    background: #fff;
    box-shadow: 0 0 1px var(--blue-dark);
  }

  .cart-toggle {
    z-index: 160;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 145;
    flex-direction: column;
    align-items: stretch;
    width: min(18rem, 90vw);
    height: 100dvh;
    padding: 0;
    gap: 0;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow: hidden;
    pointer-events: auto;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding:
      calc(max(0.85rem, env(safe-area-inset-top)) + 2.75rem + 0.65rem)
      1rem
      max(1.5rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    flex: 1;
  }

  .nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    color: #1a1a1a;
    -webkit-text-stroke: 0;
    text-shadow: none;
    padding: 0.95rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
    box-shadow: none;
    min-height: auto;
    display: block;
    text-align: center;
    -webkit-tap-highlight-color: rgba(181, 208, 228, 0.65);
    transition: background 0.15s ease;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a:active {
    background: var(--bg-blue);
    opacity: 1;
  }

  .nav-links a.is-current {
    color: var(--blue-dark);
    background: rgba(181, 208, 228, 0.35);
  }

  .cart-panel {
    width: 100%;
    max-width: 100%;
  }

  .cart-header {
    padding:
      max(0.9rem, env(safe-area-inset-top))
      1rem 0.75rem;
  }

  .cart-body {
    padding: 0.5rem 1rem;
  }

  .cart-footer {
    padding:
      0.75rem 1rem
      max(1rem, env(safe-area-inset-bottom));
  }

  .cart-checkout {
    min-height: 2.75rem;
  }

  .nav-backdrop {
    background: rgba(0, 0, 0, 0.3);
  }

  .page {
    max-width: 100%;
    width: 100%;
    padding: 0;
  }

  main {
    width: 100%;
  }

  .logo {
    padding: 0.35rem 1.25rem 0;
    gap: 0.16rem;
    max-width: 100%;
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .logo-mark {
    width: clamp(1.5rem, 5.8vw, 1.85rem);
    height: clamp(1.5rem, 5.8vw, 1.85rem);
    margin-bottom: -0.1rem;
  }

  .logo-wordmark {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
    line-height: 0.92;
    max-width: 100%;
    -webkit-text-stroke: 0.55px var(--blue-dark);
  }

  .logo-wordmark .l-luna {
    -webkit-text-stroke: 0.55px var(--blue-dark);
  }

  .logo-rule {
    width: min(9.5rem, 64vw);
    margin: 0.05rem 0;
    gap: 0.32rem;
  }

  .logo-rule svg {
    width: 0.38rem;
    height: 0.38rem;
  }

  .logo-subtitle {
    font-size: clamp(0.74rem, 3.5vw, 0.9rem);
    letter-spacing: 0.1em;
    margin-top: 0.04rem;
  }

  .cart-line-qty button {
    width: 1.75rem;
    height: 1.75rem;
  }

  .site-footer {
    margin-top: auto;
    padding: 1.5rem 0.5rem 0;
    width: 100%;
  }

  .site-footer p {
    font-size: 0.68rem;
  }

  .footer-made {
    margin-top: 0.45rem;
    gap: 0.22rem;
  }

  .footer-nm {
    height: 1.4rem;
  }
}

@media (max-width: 400px) {
  .logo {
    padding: 0.3rem 0.75rem 0;
  }

  .logo-wordmark {
    font-size: clamp(1.9rem, 11vw, 2.35rem);
  }

  .logo-mark {
    width: clamp(1.35rem, 6.2vw, 1.6rem);
    height: clamp(1.35rem, 6.2vw, 1.6rem);
  }

  .logo-rule {
    width: min(8.75rem, 72vw);
  }

  .logo-subtitle {
    font-size: clamp(0.7rem, 3.8vw, 0.82rem);
  }
}
