/* ===== CSS Variables (overridden by PHP dynamic vars) ===== */
:root {
  --primary:   #e91e8c;
  --secondary: #ff6b35;
  --accent:    #ffd700;
  --bg:        #fff9fc;
  --dark:      #1a1a2e;
  --text:      #333;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.10);
  --radius:    12px;
  --transition: 0.25s ease;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute; top: -40px; right: 0; z-index: 9999;
  background: var(--primary); color: #fff; padding: 8px 16px;
  border-radius: 0 0 8px 0; text-decoration: none; font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ===== Announcement Bar ===== */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff; text-align: center; padding: 8px 16px;
  font-size: 0.9rem; font-weight: 600;
}

/* ===== Navbar ===== */
#main-nav {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  padding: 8px 0;
}
.navbar-brand { padding: 0; }
.logo-img { height: 56px; width: auto; object-fit: contain; }
.nav-link {
  color: var(--dark) !important; font-weight: 500;
  padding: 6px 12px !important; border-radius: 8px;
  transition: background var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: rgba(233,30,140,0.08);
  color: var(--primary) !important;
}
.badge-cart {
  position: absolute; top: -6px; left: -6px;
  font-size: 0.65rem; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* ===== Search Box ===== */
.search-box .form-control {
  border-radius: 8px 0 0 8px !important;
  border-color: var(--primary); min-width: 220px;
}
.search-box .btn { border-radius: 0 8px 8px 0 !important; }

/* ===== Buttons ===== */
.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important; color: #fff;
}
.btn-primary:hover { filter: brightness(0.9); }
.btn-secondary { background-color: var(--secondary) !important; border-color: var(--secondary) !important; color:#fff; }
.btn-accent { background-color: var(--accent) !important; border-color: var(--accent) !important; color: #333; }
.btn-outline-primary { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-primary:hover { background: var(--primary) !important; color:#fff !important; }

/* ===== Hero ===== */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff; padding: 60px 20px; border-radius: var(--radius);
  margin-bottom: 2rem; text-align: center; position: relative; overflow: hidden;
}
.hero-banner::before {
  content:'🍬🍭🍫🍪🧁';
  position:absolute; top: 10px; font-size: 3rem; opacity: 0.15; right: 0; left: 0; text-align:center;
  letter-spacing: 30px;
}
.hero-banner h1 { font-size: clamp(1.8rem,5vw,3rem); font-weight: 800; margin-bottom:0.5rem; }
.hero-banner p { font-size: 1.1rem; opacity: 0.9; }

/* ===== Section Titles ===== */
.section-title {
  font-size: 1.6rem; font-weight: 800; color: var(--primary);
  position: relative; padding-bottom: 8px; margin-bottom: 1.5rem;
}
.section-title::after {
  content: ''; display: block; width: 50px; height: 4px;
  background: var(--secondary); border-radius: 2px;
  position: absolute; bottom: 0; right: 0;
}

/* ===== Product Cards ===== */
.product-card {
  border: none; border-radius: var(--radius);
  box-shadow: var(--card-shadow); transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  background: #fff;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.16); }
.product-card .card-img-top {
  height: 200px; object-fit: cover; transition: transform 0.4s;
}
.product-card:hover .card-img-top { transform: scale(1.05); }
.product-card .card-body { flex: 1; display: flex; flex-direction: column; padding: 16px; }
.product-card .card-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.product-card .product-price {
  font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-top: auto;
}
.product-card .badge-stock {
  font-size: 0.75rem; padding: 3px 8px; border-radius: 20px;
}
.stock-low { background: #fff3cd; color: #856404; }
.stock-out { background: #f8d7da; color: #721c24; }
.stock-ok  { background: #d1e7dd; color: #0f5132; }
.product-card .btn-add-cart {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 8px; font-size: 0.9rem; font-weight: 600;
  transition: background var(--transition);
}
.product-card .btn-add-cart:hover { background: var(--secondary); }
.product-card .btn-add-cart:disabled { background: #ccc; cursor: not-allowed; }
.product-img-wrap { position: relative; overflow: hidden; }
.badge-expiry {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 20px;
}

/* ===== Product Detail ===== */
.product-detail-img { border-radius: var(--radius); max-height: 420px; object-fit: cover; width: 100%; }
.info-table td:first-child { font-weight: 700; width: 140px; padding-left: 12px; }
.allergen-box { background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; padding: 12px; margin-top: 12px; }
.admin-note-box { background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 8px; padding: 12px; margin-top: 12px; }

/* ===== Cart ===== */
.cart-item { border-bottom: 1px solid #eee; padding: 12px 0; }
.cart-qty-input { width: 70px; text-align: center; }
.cart-summary { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); }

/* ===== Order status ===== */
.order-timeline { display: flex; gap: 0; margin: 20px 0; }
.order-step {
  flex: 1; text-align: center; position: relative;
  padding: 12px 8px 8px;
}
.order-step::before {
  content: ''; display: block; height: 4px; background: #dee2e6;
  position: absolute; top: 24px; right: 50%; width: 50%;
}
.order-step:first-child::before { display: none; }
.order-step.active .step-icon { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(233,30,140,0.2); }
.order-step.done .step-icon { background: #198754; color: #fff; }
.step-icon {
  width: 44px; height: 44px; border-radius: 50%; background: #dee2e6;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin: 0 auto 8px; position: relative; z-index: 1;
}
.step-label { font-size: 0.8rem; font-weight: 600; }

/* ===== Forms ===== */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 30px; }
.form-label { font-weight: 600; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233,30,140,0.15); }

/* ===== Auth pages ===== */
.auth-page { min-height: 80vh; display: flex; align-items: center; }
.auth-card { max-width: 460px; width: 100%; margin: 0 auto; }

/* ===== Footer ===== */
.site-footer {
  background: var(--dark); color: #aaa; padding: 40px 0 20px;
}
.footer-brand { color: var(--accent); font-size: 1.5rem; font-weight: 800; }
.footer-title { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: #aaa; text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.site-footer a { color: #aaa; }
.site-footer a:hover { color: var(--accent); }
.text-light-50 { color: rgba(255,255,255,0.6) !important; }

/* ===== Social Cubes ===== */
.social-cube {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 1.1rem; color: #fff; text-decoration: none;
  transition: transform var(--transition), opacity var(--transition);
}
.social-cube:hover { transform: scale(1.12); opacity: .9; color: #fff; }
.social-whatsapp  { background: #25D366; }
.social-facebook  { background: #1877F2; }
.social-instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-youtube   { background: #FF0000; }
.social-tiktok    { background: #010101; }

/* ===== Floating Buttons (WhatsApp + Waze) ===== */
.whatsapp-float, .waze-float {
  position: fixed; z-index: 1000;
  color: #fff; border-radius: 50%;
  width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  text-decoration: none; transition: transform var(--transition);
}
.whatsapp-float { bottom: 24px; left: 24px; background: #25D366; }
.whatsapp-float:hover { transform: scale(1.1); color: #fff; }
/* Waze sits above WhatsApp */
.waze-float { bottom: 94px; left: 24px; background: #00d5e0; }
.waze-float:hover { transform: scale(1.1); color: #fff; }

/* Footer business info */
.footer-slogan { color: #ffd6f0; font-weight: 600; font-size: 1rem; margin-bottom: .6rem; }
.footer-info-row { color: rgba(255,255,255,.8); margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.footer-phone { color: #ffd6f0; text-decoration: none; font-weight: 600; }
.footer-phone:hover { color: #fff; text-decoration: underline; }
.btn-waze-inline {
  display: inline-flex; align-items: center; gap: 4px;
  background: #00d5e0; color: #fff; font-size: .75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 12px; text-decoration: none;
  transition: opacity .2s;
}
.btn-waze-inline:hover { opacity: .85; color: #fff; }

/* ===== Accessibility Toolbar ===== */
#accessibility-toolbar {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%);
  z-index: 9000; direction: rtl;
}
#acc-toggle {
  background: var(--primary); color: #fff; border: none; border-radius: 8px 0 0 8px;
  padding: 12px 10px; font-size: 1.2rem; cursor: pointer;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
}
#acc-panel {
  background: #fff; border-radius: 8px 0 0 8px; box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; gap: 4px; padding: 8px 6px;
  position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
  min-width: 48px;
}
#acc-panel button {
  background: none; border: 1px solid #ddd; border-radius: 6px; padding: 6px;
  cursor: pointer; font-size: 0.85rem; font-weight: 700; transition: all 0.2s;
  white-space: nowrap;
}
#acc-panel button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Accessibility classes toggled by JS */
body.high-contrast { filter: contrast(1.5) grayscale(0.2); }
body.highlight-links a { background: #ff0 !important; color: #000 !important; text-decoration: underline !important; }

/* ===== Alerts ===== */
.alert { border-radius: var(--radius); }

/* ===== Badges ===== */
.badge-new { position: absolute; top: 10px; right: 10px; background: var(--secondary); color:#fff; border-radius: 20px; font-size:.72rem; padding: 3px 10px; font-weight:700; }

/* ===== Category pills ===== */
.cat-pill {
  display: inline-block; background: #fff; border: 2px solid var(--primary);
  color: var(--primary); border-radius: 30px; padding: 6px 18px;
  text-decoration: none; font-weight: 600; margin: 4px; transition: all var(--transition);
  font-size: 0.9rem;
}
.cat-pill:hover, .cat-pill.active { background: var(--primary); color: #fff; }

/* ===== Pagination ===== */
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ===== Utilities ===== */
.rounded-xl { border-radius: var(--radius); }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-banner { padding: 40px 16px; }
  .order-timeline { flex-direction: column; }
  .order-step::before { display: none; }
  .logo-img { height: 44px; }
}

/* ===== Print ===== */
@media print {
  #site-header, .site-footer, .whatsapp-float, #accessibility-toolbar, .no-print { display: none !important; }
  .product-card { break-inside: avoid; }
}
