:root {
  --orange: #f47721;
  --deep: #ad4810;
  --yellow: #ffc83d;
  --pale: #fff1c4;
  --cream: #fffaf1;
  --ink: #352419;
  --muted: #806c5a;
  --green: #26764a;
  --line: #f0dfc8;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Prevent oversized SVGs or images from breaking layout */
img,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* Header & Navigation */
.topbar {
  height: 72px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(5%, calc((100% - 1120px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--deep);
  font-size: 1.12rem;
  font-weight: 800;
}

.brand b {
  font-weight: 950;
}

.brand-logo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

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

.cart-button,
.install-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 850;
  cursor: pointer;
}

.cart-button {
  background: var(--orange);
  color: #fff;
}

.cart-button span {
  background: #fff;
  color: var(--deep);
  border-radius: 50px;
  padding: 2px 7px;
  margin-left: 5px;
}

.install-btn {
  background: var(--pale);
  color: var(--deep);
}

.hidden {
  display: none !important;
}

/* Hero Section */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 58px 5% 48px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  letter-spacing: 1.2px;
  font-weight: 900;
  color: var(--deep);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  letter-spacing: -2.8px;
  line-height: 0.99;
  margin: 15px 0;
  color: var(--ink);
}

h1 span {
  color: var(--orange);
}

.hero-copy p {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 500px;
}

.primary-link {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  background: var(--orange);
  color: white;
  text-decoration: none;
  padding: 14px 19px;
  border-radius: 13px;
  font-weight: 900;
  margin-top: 9px;
  box-shadow: 0 8px 20px #f4772130;
}

.trust-line {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 22px;
}

.hero-visual {
  height: 310px;
  border-radius: 32px;
  background: linear-gradient(140deg, #ffdf70, #ff9d50);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 18px 35px #b45c2020;
}

.sun-disc {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: #fff5c6;
  opacity: 0.8;
}

.hero-gift {
  font-size: 9rem;
  z-index: 1;
  filter: drop-shadow(0 16px 10px #88411e30);
  transform: rotate(-7deg);
}

.float-note {
  position: absolute;
  background: white;
  padding: 10px 14px;
  border-radius: 13px;
  font-weight: 850;
  color: var(--deep);
  font-size: 0.85rem;
  box-shadow: 0 8px 18px #6b3d2020;
}

.note-top {
  top: 22px;
  left: 18px;
}

.note-bottom {
  bottom: 20px;
  right: 16px;
}

.spark {
  position: absolute;
  color: #fff;
  font-size: 2rem;
}

.s1 {
  right: 24%;
  top: 23%;
}

.s2 {
  left: 22%;
  bottom: 25%;
}

/* Menu Section & Cards */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 35px 5% 45px;
}

.section-heading {
  text-align: center;
  margin-bottom: 25px;
}

.section-heading h2,
.checkout-title h2 {
  font-size: 2rem;
  letter-spacing: -0.8px;
  margin: 7px 0;
}

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

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* Fix #1 & #2: Flex column cards so buttons align evenly & icons never overflow */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 21px;
  overflow: hidden;
  box-shadow: 0 9px 25px #5b35100b;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px #5b351014;
}

.product-art {
  height: 130px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  font-size: 2.35rem;
  line-height: 1;
  background: linear-gradient(135deg, #fff0ae, #ffc078);
}

.product-art img,
.product-art svg {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.product-card:nth-child(2) .product-art {
  background: linear-gradient(135deg, #ffe6a1, #ffb4a0);
}

.product-card:nth-child(3) .product-art {
  background: linear-gradient(135deg, #ffe08b, #ff9a4f);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
}

.product-info h3 {
  font-size: 1.25rem;
  margin: 0;
}

.product-price {
  font-size: 1.75rem;
  color: var(--deep);
  font-weight: 950;
  margin: 7px 0;
}

.product-price small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.product-info ul {
  padding-left: 20px;
  line-height: 1.75;
  color: #705c49;
  margin: 8px 0 20px;
}

.add-button {
  margin-top: auto;
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  padding: 13px;
  font-weight: 900;
  cursor: pointer;
}

.add-button:active,
.checkout-button:active {
  transform: scale(0.99);
}

/* Checkout Section */
.checkout-section {
  max-width: 1000px;
  margin: 10px auto 42px;
  padding: 28px 5%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 23px;
  box-shadow: 0 10px 28px #5b35100b;
}

.checkout-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-count-large {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-items {
  margin-top: 15px;
}

.empty-cart {
  color: var(--muted);
  padding: 12px 0;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.cart-row-name {
  font-weight: 750;
}

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

.qty-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.subtotal {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 16px 0 4px;
  margin-top: 10px;
  font-size: 1.15rem;
}

.subtotal strong {
  color: var(--deep);
}

.small-muted,
.form-note {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Fix #3: Prevent grid column overflow & dropdown text truncation */
.order-form {
  margin-top: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: block;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  border: 1px solid #dfcfbc;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
}

select {
  padding-right: 34px;
  text-overflow: ellipsis;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.checkout-button {
  width: 100%;
  margin-top: 17px;
  background: var(--orange);
  border: 0;
  border-radius: 12px;
  padding: 15px;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.checkout-button span {
  float: right;
}

.form-note {
  text-align: center;
}

/* Admin section */
.admin-section {
  max-width: 1000px;
  margin: 0 auto 45px;
  padding: 0 5%;
}
.admin-section details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 17px 20px;
  box-shadow: 0 8px 24px #5b35100b;
}
.admin-section summary {
  color: var(--deep);
  font-weight: 850;
  cursor: pointer;
}
.admin-panel { padding-top: 14px; }
.admin-login {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--cream);
  border-radius: 14px;
}
.admin-login label { flex: 1 1 220px; }
.secondary-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  background: var(--green);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}
.tiny { width: 100%; margin: 0; color: var(--muted); font-size: .78rem; }
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-toolbar h3 { margin: 12px 0; }
.admin-orders { display: grid; gap: 13px; }
.admin-order {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: #fffdf9;
  overflow-wrap: anywhere;
}
.admin-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 850;
  color: var(--deep);
}
.admin-order p { color: var(--muted); line-height: 1.65; }
.admin-order label { max-width: 360px; }
.manual-form {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--cream);
}
.manual-form h4 { margin: 0 0 14px; }
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 22px 5%;
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}
footer img { width: 34px; height: 34px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 18px);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 24px #0003;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #26764a55;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 4%; }
  .brand { font-size: .98rem; gap: 7px; }
  .brand-logo { width: 44px; height: 44px; }
  .top-actions { gap: 6px; }
  .cart-button, .install-btn { padding: 9px 11px; font-size: .82rem; }
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 38px 5% 28px;
  }
  h1 { font-size: clamp(2.45rem, 11vw, 3.5rem); letter-spacing: -1.8px; }
  .hero-copy p { font-size: 1rem; }
  .hero-visual { height: 240px; border-radius: 24px; }
  .hero-gift { font-size: 7rem; }
  .sun-disc { width: 190px; height: 190px; }
  .section { padding: 28px 5% 34px; }
  .product-grid { grid-template-columns: 1fr; gap: 16px; }
  .product-art { height: 112px; }
  .product-info { padding: 17px; }
  .checkout-section { margin: 8px 4% 32px; padding: 22px 5%; }
  .checkout-title h2, .section-heading h2 { font-size: 1.65rem; }
  .field-grid { grid-template-columns: 1fr; gap: 13px; }
  .full { grid-column: auto; }
  .admin-section { padding: 0 4%; }
  .admin-section details { padding: 15px; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .product-grid { gap: 14px; }
  .product-info { padding: 15px; }
  .product-info ul { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* UAT hotfix: keep brand artwork small even if older cached styles remain */
.topbar .brand-logo {
  display: block !important;
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  max-height: 60px !important;
  object-fit: contain;
  flex: 0 0 60px !important;
}
footer img {
  display: block !important;
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  object-fit: contain;
}
.hero-visual {
  width: 100%;
  max-width: 520px;
  height: 310px;
  justify-self: center;
}
/* Fix full Happy Snack Box image */
.hero-visual {
  height: auto !important;
  min-height: 300px;
  overflow: visible !important;
  padding: 10px;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 360px;
  object-fit: contain !important;
}

.hero-visual .float-note {
  display: none;
}
