/* Mega-Sweets ordering website — layout & section styles.
   Requires colors_and_type.css + components.css. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ms-sand); color: var(--fg1); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; }
a { cursor: pointer; }

/* ---------- HEADER ---------- */
.sh {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 32px;
  background: rgba(255,253,249,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ms-line);
}
.sh-brand img { height: 40px; display: block; }
.sh-cta { margin-left: auto; }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 82% 8%, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 42%),
    linear-gradient(165deg, var(--ms-skypastel) 0%, #e9f3f1 30%, var(--ms-sand-2) 72%, var(--ms-sand) 100%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 56px 32px 60px; }
.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art img { width: 100%; max-width: 460px; filter: drop-shadow(0 18px 36px rgba(80,60,110,.26)); transform: rotate(-2deg); }
.hero-title { font-size: 60px; line-height: 1.02; margin: 8px 0 14px; color: var(--ms-blue); }
.hero-title .amp { color: var(--ms-magenta); }
.hero-sub { font-size: 18px; line-height: 1.5; color: var(--fg2); max-width: 440px; }
.hero-actions { display: flex; gap: 14px; margin: 22px 0 28px; }
.hero-prices { display: flex; align-items: center; gap: 22px; }
.hero-prices > div { display: flex; flex-direction: column; }
.hp-label { font-family: var(--font-rounded); font-weight: 700; font-size: 13px; color: var(--ms-teal); }
.price small { font-size: .5em; font-weight: 600; color: var(--ms-ink-soft); margin-left: 2px; }

/* ---------- PRODUCT FEATURE ---------- */
.prod { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 64px 32px; max-width: 1080px; margin: 0 auto; }
.prod-card { display: flex; gap: 18px; align-items: center; background: var(--ms-cream); border: 1px solid var(--ms-line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.prod-card img { width: 150px; flex: none; filter: drop-shadow(var(--shadow-product)); }
.prod-meta h3 { margin: 0 0 6px; }
.prod-meta .price { display: block; margin-top: 10px; }

/* ---------- SECTION HEADS ---------- */
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.sec-head h2 { margin: 8px 0 6px; }

/* ---------- FLAVORS ---------- */
.flavors { padding: 56px 32px 64px; background: var(--ms-sand-2); }
.flavor-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; max-width: 1000px; margin: 0 auto; }
.flavor-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; background: #fff; border-radius: var(--radius-md); padding: 18px 8px 14px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s; }
.flavor-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.flavor-tile img { height: 64px; width: 100%; object-fit: contain; flex: none; filter: drop-shadow(0 4px 6px rgba(80,60,110,.18)); }
.flavor-tile .label { font-size: 13px; line-height: 1.2; text-align: center; min-height: 2.4em; display: flex; align-items: flex-start; justify-content: center; }
.flourish { display: block; max-width: 680px; width: 100%; margin: 30px auto 8px; }
.flavors-foot { text-align: center; max-width: 720px; margin: 0 auto 24px; color: var(--ms-blue); font-weight: 600; }

/* ---------- PACKAGES ---------- */
.packages { padding: 64px 32px; max-width: 1080px; margin: 0 auto; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pkg-card { display: flex; flex-direction: column; }
.pkg-name { margin: 0 0 12px; font-size: 30px; }
.pkg-name--sky { color: var(--ms-sky); }
.pkg-name--purple { color: var(--ms-purple); }
.pkg-name--magenta { color: var(--ms-magenta); }
.pkg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pkg-list li { font-family: var(--font-sans); color: var(--fg2); font-size: 15px; }
.pkg-foot { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.pkg-btn { width: 100%; justify-content: center; margin-top: auto; }

/* ---------- FEATURE STRIP ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 24px 32px 72px; max-width: 1080px; margin: 0 auto; }
.feature { display: flex; gap: 12px; align-items: center; }
.feature img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.feature-title { font-family: var(--font-rounded); font-weight: 700; color: var(--ms-blue); font-size: 15px; }

/* ---------- FOOTER ---------- */
.sf { text-align: center; padding: 44px 32px; background: linear-gradient(180deg, #efe7f0, var(--ms-sand)); border-top: 1px solid var(--ms-line); }
.sf-logo { height: 46px; margin-bottom: 8px; }
.sf-tag { display: block; margin: 0 0 16px; }
.sf-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.sf-links a { font-family: var(--font-rounded); font-weight: 600; font-size: 14px; color: var(--ms-blue); text-decoration: none; }
.sf-links a:hover { color: var(--ms-magenta); }
.sf-fine { color: var(--ms-ink-soft); }

/* ---------- BUILD A BOX ---------- */
.build { max-width: 1080px; margin: 0 auto; padding: 24px 32px 64px; }
.build-back { margin-bottom: 8px; }
.build-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.build-step { margin: 28px 0 12px; }
.opt-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opt { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: #fff; border: 2px solid var(--ms-line); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .2s; }
.opt:hover { border-color: var(--ms-skypastel); }
.opt--on { border-color: var(--ms-purple); box-shadow: 0 0 0 4px rgba(126,64,207,.12); }
.opt-name { font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--ms-blue); }
.opt-price { font-family: var(--font-serif); font-weight: 800; font-size: 22px; color: var(--ms-magenta); margin-top: 2px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.flavor-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-rounded); font-weight: 600; font-size: 14px; color: var(--ms-blue); background: #fff; border: 2px solid var(--ms-line); border-radius: var(--radius-pill); padding: 6px 14px 6px 6px; cursor: pointer; transition: all .15s; }
.flavor-chip img { width: 30px; height: 30px; object-fit: contain; }
.flavor-chip:hover { border-color: var(--ms-pink); }
.flavor-chip--on { border-color: var(--ms-magenta); background: var(--ms-pink-50); box-shadow: 0 4px 10px rgba(216,30,114,.16); }
.upgrade { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--ms-line); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; }
.upgrade input { width: 18px; height: 18px; accent-color: var(--ms-purple); }

/* summary */
.summary { position: sticky; top: 84px; background: var(--ms-cream); border: 2px solid transparent; background-image: linear-gradient(var(--ms-cream),var(--ms-cream)), var(--grad-border); background-origin: border-box; background-clip: padding-box, border-box; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-md); }
.sum-row { display: flex; justify-content: space-between; font-family: var(--font-sans); font-weight: 700; color: var(--fg2); margin-bottom: 4px; }
.sum-sub { font-size: 13px; color: var(--ms-ink-soft); margin-bottom: 12px; }
.sum-flavors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.sum-total { display: flex; align-items: baseline; justify-content: space-between; }
.sum-total span:first-child { font-family: var(--font-serif); font-weight: 700; font-size: 20px; }
.sum-cta { width: 100%; justify-content: center; margin-top: 16px; }
.sum-cta:disabled { opacity: .5; cursor: not-allowed; }
.sum-note { text-align: center; margin: 10px 0 0; }

/* ---------- CONFIRMATION ---------- */
.confirm { max-width: 600px; margin: 0 auto; padding: 48px 32px 72px; text-align: center; }
.confirm-flourish { max-width: 420px; margin: 0 auto 8px; display: block; }
.confirm h1 { margin: 6px 0; }
.confirm-card { text-align: left; margin: 24px 0; }

/* ---------- RESPONSIVE ---------- */
/* Order-details (quote request) step */
.od-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.od-req { color: var(--ms-magenta); }
.od-error { margin-top: 12px; color: var(--ms-magenta); font-weight: 700; }

@media (max-width: 900px) {
  .features, .flavor-grid { grid-template-columns: 1fr 1fr; }
  /* product + package cards become swipe carousels on mobile (one card, next peeks) */
  .prod, .pkg-grid { display: flex; overflow-x: auto; gap: 16px;
    scroll-snap-type: x mandatory; scroll-padding: 0 20px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; }
  .prod::-webkit-scrollbar, .pkg-grid::-webkit-scrollbar { display: none; }
  .prod-card, .pkg-card { flex: 0 0 86%; scroll-snap-align: center; }
  .prod { padding: 48px 20px; }
  .packages { padding: 48px 20px; }
  .build-grid { grid-template-columns: 1fr; }
  .od-row { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .summary { position: static; }
  .hero-title { font-size: 44px; }
}

/* ===================== Admin panel ===================== */
.adm { min-height: 100vh; background: var(--ms-sand); }
.adm-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; background: var(--ms-white); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.adm-brand { display: flex; align-items: center; gap: 10px; }
.adm-brand img { height: 30px; }
.adm-brand span { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--ms-ink); }
.adm-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-main { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }
.adm-sec { padding: 20px; margin-bottom: 18px; }
.adm-sec h3 { margin: 0 0 14px; }
.adm-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.adm-sec-head h3 { margin: 0; }
.adm-row { padding: 14px; border: 1px solid var(--ms-line); border-radius: var(--radius-md); margin-bottom: 14px; background: var(--ms-cream); }
.adm-del { color: var(--ms-magenta); margin-top: 6px; padding: 6px 10px; }

/* image fields */
.adm-img { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px dotted var(--ms-line); }
.adm-img:first-of-type { border-top: none; }
.adm-img-prev { width: 76px; height: 76px; flex: none; border-radius: var(--radius-md); overflow: hidden; background: var(--ms-white);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.adm-img-prev img { width: 100%; height: 100%; object-fit: cover; }
.adm-img-label { font-weight: 700; margin-bottom: 6px; }
.adm-upload { cursor: pointer; display: inline-block; }

.adm-flavor { display: flex; align-items: flex-start; gap: 14px; }
.adm-flavor-img { width: 56px; height: 56px; flex: none; border-radius: var(--radius-md); overflow: hidden; background: var(--ms-white); box-shadow: var(--shadow-sm); }
.adm-flavor-img img { width: 100%; height: 100%; object-fit: cover; }
.adm-flavor-fields { flex: 1; }

.adm-save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 14px; background: rgba(255,255,255,0.92); backdrop-filter: blur(6px); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.adm-ok { color: var(--ms-green, #1b9c6a); font-weight: 700; }

/* login */
.adm-login { min-height: 100vh; background: var(--ms-sand); display: flex; align-items: center; justify-content: center; padding: 20px; }
.adm-login-card { width: 100%; max-width: 380px; padding: 28px; text-align: center; }
.adm-login-logo { height: 40px; margin-bottom: 8px; }

/* analytics */
.adm-period { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.adm-stat { padding: 18px; text-align: center; }
.adm-stat-n { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 700; color: var(--ms-magenta); line-height: 1; }
.adm-bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.adm-bar-label { width: 92px; flex: none; }
.adm-bar { flex: 1; height: 12px; background: var(--ms-line); border-radius: var(--radius-pill); overflow: hidden; }
.adm-bar-fill { display: block; height: 100%; background: var(--ms-purple); border-radius: var(--radius-pill); min-width: 2px; }
.adm-bar-n { width: 40px; flex: none; text-align: right; }
.adm-list-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--ms-line); }
.adm-list-row:last-child { border-bottom: none; }
.adm-list-n { font-weight: 700; color: var(--ms-blue); }

@media (max-width: 560px) { .adm-stats { grid-template-columns: 1fr; } }
.adm-hint { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--ms-ink-soft); }
