/* ============================================================
   Alkhateeb Apiary — Custom Stylesheet
   Supplements Tailwind CSS CDN (loaded separately in HTML)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── Base ─────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Arabic text rendering */
[dir="rtl"],
.arabic {
  font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
  letter-spacing: 0;
}

/* ── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #fef3c7; }
::-webkit-scrollbar-thumb { background: #d97706; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b45309; }

/* ── Focus ───────────────────────────────────────────────── */

input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18) !important;
}

/* ── Animations ──────────────────────────────────────────── */

@keyframes honeyShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.honey-shimmer {
  background: linear-gradient(90deg, #d97706 25%, #fbbf24 50%, #d97706 75%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: honeyShimmer 4s linear infinite;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
  animation: fadeSlideUp 0.5s ease forwards;
}

@keyframes cartItemIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item-animate {
  animation: cartItemIn 0.3s ease;
}

/* ── Availability Bar ────────────────────────────────────── */

.availability-track {
  position: relative;
  height: 8px;
  border-radius: 9999px;
  background-color: #f3f4f6;
  overflow: hidden;
}

.availability-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Knob dot on the bar */
.availability-knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Product Cards ───────────────────────────────────────── */

.product-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(120, 53, 15, 0.12);
}

/* Gallery panel split */
.gallery-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 180px;
}

.gallery-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-size: 4rem;
  position: relative;
}

.gallery-panel--jar   { border-right: 1px solid rgba(255,255,255,0.6); }

/* ── Quantity Stepper ────────────────────────────────────── */

.qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── WhatsApp Button ─────────────────────────────────────── */

.btn-whatsapp {
  background-color: #25D366;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.btn-whatsapp:hover  { background-color: #1EBF5A; }
.btn-whatsapp:active { transform: scale(0.98); }

/* ── Honeycomb SVG Helper ────────────────────────────────── */
/*
 * Proper pointy-top hexagonal tile (R=40px).
 * Tile: 70×120 px.  Four polygon declarations cover all
 * tiling seams — the pattern repeats perfectly.
 *   Hex centers:  (35, 0) top/bottom  ·  (0,60) and (70,60) sides
 */
.hex-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='120'%3E%3Cpolygon points='35,-40 70,-20 70,20 35,40 0,20 0,-20' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1.5'/%3E%3Cpolygon points='0,20 35,40 35,80 0,100 -35,80 -35,40' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1.5'/%3E%3Cpolygon points='70,20 105,40 105,80 70,100 35,80 35,40' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1.5'/%3E%3Cpolygon points='35,80 70,100 70,140 35,160 0,140 0,100' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 70px 120px;
}

/* ── Cart Badge Pulse ────────────────────────────────────── */

#cart-badge:not(.hidden) {
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  from { transform: scale(0.5); }
  to   { transform: scale(1); }
}

/* ── Section transitions ─────────────────────────────────── */

.section-divider {
  text-align: center;
  color: #d97706;
  font-size: 1.25rem;
  letter-spacing: 0.6rem;
  opacity: 0.35;
  user-select: none;
}

/* ── Confirmation Modal ──────────────────────────────────── */

#order-modal {
  backdrop-filter: blur(4px);
}

/* ── RTL (Arabic) overrides ──────────────────────────────── */

[dir="rtl"] .gallery-panel--jar {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.6);
}

[dir="rtl"] .availability-knob {
  transform: translate(50%, -50%);
}

[dir="rtl"] #cart-badge {
  right: auto;
  left: -6px;
}
