/* ================================================================
   shared.css — Estilos partilhados CakeShop.mz
   ================================================================ */

:root {
  --rose: #f9a8bf;
  --rose-light: #fde8ef;
  --rose-dark: #e8789a;
  --cream: #fff8f5;
  --charcoal: #1c1c1e;
  --green-wa: #25D366;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--cream);
  color: var(--charcoal);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* ── NAV ── */
#topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255,248,245,0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(249,168,191,0.25);
  height: 56px;
}
#topnav .inner {
  max-width: 960px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.logo { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 20px; text-decoration: none; color: var(--charcoal); display: flex; align-items: center; gap: 6px; }
.logo span { color: var(--rose-dark); }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-size: 13px; font-weight: 500; padding: 6px 12px;
  border-radius: 20px; text-decoration: none; color: #555;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover, .nav-links a.active { background: var(--rose-light); color: var(--rose-dark); }

/* ── CART BUTTON ── */
#cart-btn {
  position: relative; background: none; border: none; cursor: pointer;
  font-size: 22px; padding: 4px 8px; border-radius: 50%;
  transition: background 0.2s;
}
#cart-btn:hover { background: var(--rose-light); }
#cart-count {
  position: absolute; top: -2px; right: -4px;
  background: var(--rose-dark); color: #fff;
  border-radius: 9999px; min-width: 18px; height: 18px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── STICKY BANNER ── */
#sticky-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--charcoal); color: #fff;
  padding: 9px 16px; text-align: center; font-size: 12.5px;
  letter-spacing: 0.01em;
}
#sticky-banner strong { color: var(--rose); }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(28,28,30,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein 0.2s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: var(--cream); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 500px; padding: 24px 20px 48px;
  max-height: 92vh; overflow-y: auto;
  animation: slideUp 0.32s cubic-bezier(.22,1,.36,1);
}
@keyframes slideUp { from { transform: translateY(110%); } to { transform: translateY(0); } }

/* ── SPINNER ── */
.spinner {
  width: 34px; height: 34px; margin: 24px auto;
  border: 3px solid rgba(249,168,191,0.3);
  border-top-color: var(--rose-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
#toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  background: var(--charcoal); color: #fff; border-radius: 14px;
  padding: 11px 20px; font-size: 13.5px; font-weight: 500; z-index: 300;
  opacity: 0; transition: opacity 0.28s; pointer-events: none;
  white-space: nowrap; max-width: 90vw; text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
#toast.show { opacity: 1; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--rose-dark); color: #fff;
  border: none; border-radius: 16px; font-weight: 600;
  font-size: 14px; padding: 13px 20px; cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  width: 100%; text-align: center; display: block;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-wa {
  background: var(--green-wa); color: #fff;
  border: none; border-radius: 16px; font-weight: 600;
  font-size: 14px; padding: 13px 20px; cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  width: 100%; text-align: center; display: flex;
  align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn-wa:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-ghost {
  background: none; border: 1.5px solid #e0e0e0; border-radius: 14px;
  font-size: 13px; font-weight: 500; color: #555; padding: 10px 16px;
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
  width: 100%; text-align: center;
}
.btn-ghost:hover { border-color: var(--rose-dark); color: var(--rose-dark); }

/* ── PRODUCT CARD ── */
.product-card {
  background: #fff; border-radius: 20px;
  overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 32px rgba(232,120,154,0.18); }
.product-card img, .product-card .img-placeholder {
  width: 100%; height: 148px; object-fit: cover;
}
.product-card .img-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: var(--rose-light);
}
.product-card .card-body { padding: 12px; }
.product-card .cat-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--rose-dark); margin-bottom: 3px;
}
.product-card .card-title {
  font-size: 14px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.product-card .card-price {
  font-size: 16px; font-weight: 700; color: var(--charcoal);
  margin-bottom: 8px;
}
.product-card .card-add {
  width: 100%; background: var(--rose-dark); color: #fff;
  border: none; border-radius: 10px; padding: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: filter 0.2s;
}
.product-card .card-add:hover { filter: brightness(1.08); }

/* ── INPUT ── */
.field-label { font-size: 12px; font-weight: 600; color: #666; margin-bottom: 5px; display: block; }
.field-input {
  width: 100%; border: 1.5px solid #e5e5e5; border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  background: #fff; transition: border-color 0.2s;
}
.field-input:focus { outline: none; border-color: var(--rose-dark); }
select.field-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

/* ── SECTION TITLES ── */
.section-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; }
.section-sub { color: #888; font-size: 14px; margin-top: 4px; }

/* ── COURSE CARD ── */
.course-card {
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 3px 16px rgba(0,0,0,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(232,120,154,0.15); }
.course-card .course-banner {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-size: 64px; position: relative;
}
.course-card .course-body { padding: 18px; }
.course-card .course-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; margin-bottom: 8px;
  background: var(--rose-light); color: var(--rose-dark);
}
.course-card .course-title { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.course-card .course-meta { display: flex; gap: 12px; font-size: 12px; color: #888; margin-bottom: 10px; flex-wrap: wrap; }
.course-card .course-desc { font-size: 13.5px; color: #555; line-height: 1.6; margin-bottom: 16px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--rose); border-radius: 4px; }

/* ── TABS ── */
.tab-btn { padding: 7px 18px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1.5px solid #e5e5e5; background: #fff; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.tab-btn.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

/* ── CART PANEL (side drawer on desktop, bottom sheet on mobile) ── */
#cart-panel {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 150;
  width: min(380px, 100vw);
  background: var(--cream); box-shadow: -4px 0 40px rgba(0,0,0,0.14);
  display: flex; flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}
#cart-panel.open { transform: translateX(0); }
#cart-overlay {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(28,28,30,0.45); backdrop-filter: blur(3px);
  display: none;
}
#cart-overlay.open { display: block; }

@media (max-width: 600px) {
  #cart-panel {
    top: auto; width: 100%; height: 92vh; border-radius: 24px 24px 0 0;
    transform: translateY(110%);
  }
  #cart-panel.open { transform: translateY(0); }
}

.cart-header { padding: 20px 18px 14px; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between; }
.cart-items { flex: 1; overflow-y: auto; padding: 14px 18px; }
.cart-footer { padding: 16px 18px 24px; border-top: 1px solid rgba(0,0,0,0.06); }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.cart-item-thumb {
  width: 50px; height: 50px; border-radius: 10px; overflow: hidden;
  flex-shrink: 0; background: var(--rose-light);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: #888; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid #e5e5e5; background: #fff; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 600; transition: border-color 0.2s; }
.qty-btn:hover { border-color: var(--rose-dark); color: var(--rose-dark); }
.qty-val { font-size: 13px; font-weight: 700; min-width: 18px; text-align: center; }

/* ── PROGRESS BAR ── */
.progress-wrap { height: 5px; background: #eee; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: var(--rose-dark); border-radius: 5px; transition: width 0.3s; width: 0%; }

/* ── STEP INDICATOR ── */
.step-indicator { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step-dot.done { background: #d4edda; color: #155724; }
.step-dot.active { background: var(--rose-dark); color: #fff; }
.step-dot.pending { background: #f0f0f0; color: #aaa; }
.step-line { flex: 1; height: 2px; background: #eee; border-radius: 2px; }
.step-line.done { background: var(--rose-light); }
