/* SureHalal4u -- hand-written CSS, no Tailwind/Node build step. */

:root {
  --halal-900: #0b4f44;
  --halal-700: #0f6b5c;
  --halal-600: #128a75;
  --halal-500: #16a085;
  --halal-100: #dcf0ec;
  --halal-50:  #f2faf8;

  --gold-700: #96690a;
  --gold-600: #b8860b;
  --gold-500: #d4a017;
  --gold-100: #faf1da;

  --ink-900: #1a2e2a;
  --ink-700: #33473f;
  --ink-600: #4b5f5a;
  --ink-500: #6b7f7a;
  --ink-300: #a7b8b3;

  --border: #e2e8e6;
  --paper: #f7faf9;
  --white: #ffffff;

  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --success: #0f6b5c;
  --success-bg: #e7f5f1;

  --radius: 10px;
  --shadow: 0 2px 10px rgba(15, 46, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.55;
}
a { color: var(--halal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; color: var(--ink-900); }
p { margin: 0 0 1em; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* --- Buttons --------------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-primary { background: var(--gold-600); color: var(--white); }
.btn-primary:hover { background: var(--gold-700); }
.btn-secondary { background: var(--white); color: var(--halal-700); border-color: var(--halal-700); }
.btn-secondary:hover { background: var(--halal-50); }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-primary[disabled], .btn-secondary[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Header ------------------------------------------------------------ */
.site-header {
  background: var(--halal-700);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
}
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: block;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-slogan { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.8); }
.main-nav { display: flex; gap: 1.4rem; align-items: center; }
.main-nav a { color: rgba(255,255,255,0.92); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--white); text-decoration: none; }
.main-nav a.active { color: var(--white); position: relative; }
.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.4rem;
  height: 3px;
  border-radius: 2px;
  background: var(--gold-500, var(--gold-600));
}
.main-nav .btn-primary { color: var(--white); padding: 0.5rem 1.1rem; }
.main-nav .btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.75); padding: 0.5rem 1.1rem; }
.main-nav .btn-secondary:hover { background: rgba(255,255,255,0.12); }
/* The current page's pill button gets a filled/inverted look instead of the
   underline above -- an underline is invisible against its own background. */
.main-nav .btn-primary.active { background: var(--gold-700); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); }
.main-nav .btn-secondary.active { background: rgba(255,255,255,0.22); }
.main-nav a.btn-primary.active::after, .main-nav a.btn-secondary.active::after { display: none; }

/* --- Hero ---------------------------------------------------------------*/
.hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(rgba(11,79,68,0.72), rgba(11,79,68,0.72)), var(--halal-900) center/cover no-repeat;
  padding: 5rem 0;
  text-align: center;
}
.hero.has-image { background-image: linear-gradient(rgba(11,79,68,0.62), rgba(11,79,68,0.72)), var(--hero-bg-image, none); background-size: cover; background-position: center; }
.hero h1 { font-size: 2.4rem; font-weight: 800; color: var(--white); max-width: 720px; margin: 0 auto 0.75rem; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,0.92); max-width: 640px; margin: 0 auto 1.75rem; }
.hero-actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.8); }
.hero-actions .btn-secondary:hover { background: rgba(255,255,255,0.12); }
.eid-banner {
  background: var(--gold-100);
  color: var(--gold-700);
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* --- Occasion cards (Eid ul-Adha vs. Aqeeqah) -----------------------------
   The site's two primary actions -- large clickable panels rather than a
   single generic "Order Now" button, since each occasion has its own
   catalog and its own ordering rules. */
.occasion-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 900px; margin: 0 auto; }
.occasion-card {
  display: block;
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--white) !important;
  text-decoration: none !important;
  transition: transform 0.15s ease;
}
.occasion-card:hover { transform: translateY(-2px); }
.occasion-card.occasion-eid { background: linear-gradient(135deg, var(--halal-600), var(--halal-900)); }
.occasion-card.occasion-aqeeqah { background: linear-gradient(135deg, var(--gold-500), var(--gold-700)); }
.occasion-eyebrow { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.85); margin-bottom: 0.5rem; }
.occasion-card h3 { color: var(--white); font-size: 1.5rem; margin: 0 0 0.6rem; }
.occasion-card p { color: rgba(255,255,255,0.92); font-size: 0.95rem; margin-bottom: 0.75rem; }
.occasion-status { display: inline-block; font-size: 0.82rem; font-weight: 600; background: rgba(255,255,255,0.18); border-radius: 999px; padding: 0.25rem 0.75rem; margin-bottom: 0.75rem; }
.occasion-cta { display: block; font-weight: 700; color: var(--white); }

/* --- Page header (Learn More / Order / Privacy Policy) ------------------ */
.page-header { padding: 2.75rem 0 1.5rem; text-align: center; }
.page-header .kicker { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--halal-600); }
.page-header h1 { font-size: 2rem; }
.page-header p { color: var(--ink-600); max-width: 640px; margin: 0.5rem auto 0; }

/* --- Sections ------------------------------------------------------------*/
.section { padding: 3rem 0; }
.section-title { text-align: center; font-size: 1.6rem; margin-bottom: 2rem; }
.section-title .eyebrow { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-600); margin-bottom: 0.4rem; }

/* --- Qurbani option cards ------------------------------------------------*/
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.option-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* No icon/emoji -- the header itself is the card's visual: a branded
   gradient with the option's own name and animal type, or its real photo
   (with a dark overlay so the text stays legible) when one is set. */
.option-card-header {
  position: relative;
  padding: 1.75rem 1.25rem 1.5rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--halal-600), var(--halal-900));
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.option-card-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.5px);
  background-size: 15px 15px;
  pointer-events: none;
}
.option-card-header.has-image::before { display: none; }
.option-card-eyebrow {
  position: relative;
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-500);
  margin-bottom: 0.35rem;
}
.option-card-title { position: relative; margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--white); line-height: 1.3; }
.option-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.option-region { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--halal-600); margin-bottom: 0.4rem; }
.option-desc { color: var(--ink-600); font-size: 0.9rem; flex: 1; }
.option-price-row { display: flex; align-items: baseline; justify-content: space-between; margin: 0.9rem 0; }
.option-price { font-size: 1.35rem; font-weight: 800; color: var(--ink-900); }
.option-price .per-share { font-size: 0.78rem; font-weight: 500; color: var(--ink-500); }
.option-qty { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.option-qty input { width: 4.5rem; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.option-qty label { font-size: 0.85rem; color: var(--ink-600); }
.in-cart-indicator { margin-top: 0.6rem; font-size: 0.82rem; color: var(--halal-700); background: var(--halal-50); border-radius: 6px; padding: 0.4rem 0.6rem; }
.in-cart-indicator .cart-line-remove { font-size: 0.78rem; }

/* --- Forms --------------------------------------------------------------*/
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  max-width: 640px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.form-group .hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="password"], input[type="url"], textarea, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink-900);
  background: var(--white);
}
textarea { resize: vertical; min-height: 90px; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.form-errors { background: var(--danger-bg); color: var(--danger); border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 1.25rem; }
.form-errors ul { margin: 0; padding-left: 1.1rem; }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Checkout: email verification + per-unit dedications ----------------*/
.email-verify-row { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.email-verify-row .hint { margin-top: 0; }
.email-verify-row .hint.ok { color: var(--success); font-weight: 600; }
.email-verify-row .hint.error { color: var(--danger); }
.dedication-group { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.1rem; margin: 0 0 1.1rem; background: var(--halal-50); }
.dedication-group h4 { margin: 0 0 0.85rem; font-size: 0.95rem; }
.dedication-unit { margin-bottom: 0.85rem; padding-bottom: 0.85rem; border-bottom: 1px dashed var(--border); }
.dedication-unit:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.dedication-unit .unit-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--halal-600); margin-bottom: 0.4rem; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
@media (max-width: 640px) { .field-row-3 { grid-template-columns: 1fr; } }

/* --- Cart / order summary ------------------------------------------------*/
.cart-summary { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; max-width: 640px; margin: 0 auto 1.5rem; }
.cart-line { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.cart-line:last-of-type { border-bottom: none; }
.cart-line .cart-line-name { font-weight: 600; }
.cart-line .cart-line-meta { color: var(--ink-500); font-size: 0.82rem; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.15rem; padding-top: 0.9rem; margin-top: 0.5rem; border-top: 2px solid var(--ink-900); }
.cart-empty { color: var(--ink-500); text-align: center; padding: 1.5rem 0; }
.cart-line-remove { background: none; border: none; padding: 0; margin-top: 0.2rem; font-size: 0.78rem; color: var(--danger); text-decoration: underline; cursor: pointer; }
.cart-line-remove:hover { color: #7d1c17; }

/* --- Flash messages -------------------------------------------------------*/
.flash { max-width: 1100px; margin: 1rem auto 0; padding: 0 1.25rem; }
.flash-message { border-radius: 8px; padding: 0.8rem 1.1rem; margin-bottom: 0.6rem; font-size: 0.92rem; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); }

/* --- Footer ---------------------------------------------------------------*/
.site-footer { background: var(--halal-900); color: rgba(255,255,255,0.85); padding: 2.5rem 0 1.5rem; margin-top: 3rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer .footer-tagline { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-top: 0.3rem; }
.footer-powered { display: block; margin-top: 0.35rem; font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.footer-bottom { text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.15); }

/* --- Order confirmation -------------------------------------------------*/
.confirmation-card { text-align: center; max-width: 560px; margin: 3rem auto; }
.confirmation-icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* --- Admin ----------------------------------------------------------------*/
.admin-bar { background: var(--ink-900); color: var(--white); position: sticky; top: 0; z-index: 20; }
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.25rem; flex-wrap: wrap; gap: 0.75rem; }
.admin-bar .brand-name { color: var(--white); }
.admin-nav { display: flex; gap: 1.2rem; }
.admin-nav a { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.9rem; }
.admin-nav a:hover { color: var(--white); text-decoration: none; }
.admin-main { padding: 2rem 0 3rem; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-decoration: none !important; color: inherit; }
.stat-card:hover { border-color: var(--halal-600); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--halal-700); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--ink-600); }
table.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.admin-table th { background: var(--halal-50); font-weight: 700; color: var(--ink-700); }
table.admin-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-pending, .badge-book-pending { background: var(--gold-100); color: var(--gold-700); }
.badge-confirmed, .badge-book-approved { background: var(--success-bg); color: var(--success); }
.badge-cancelled, .badge-book-rejected { background: var(--danger-bg); color: var(--danger); }
.status-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.status-tab { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ink-600); background: var(--white); border: 1px solid var(--border); text-decoration: none !important; }
.status-tab:hover { border-color: var(--halal-600); }
.status-tab.active { background: var(--halal-700); color: var(--white); border-color: var(--halal-700); }
.admin-actions { display: flex; gap: 0.4rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--white); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--halal-50); }
.icon-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.pagination { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.pagination-info { font-size: 0.85rem; color: var(--ink-500); }
.admin-login-wrap { max-width: 380px; margin: 4rem auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* --- Qurbani Book (public gallery) -----------------------------------
   Icons demonstrate the interaction: a magnifying-glass overlay hints
   "click to enlarge" on hover, and a camera icon fills the empty state
   before any photos are approved for a year. */
.year-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.year-pill { display: inline-block; padding: 0.5rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; background: var(--white); border: 1px solid var(--border); color: var(--ink-700); text-decoration: none !important; }
.year-pill:hover { border-color: var(--halal-600); }
.year-pill.active { background: var(--halal-700); border-color: var(--halal-700); color: var(--white); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; }
.book-photo {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--halal-50);
  aspect-ratio: 4 / 3;
}
.book-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-photo-zoom {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  background: rgba(11,79,68,0);
  color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.book-photo:hover .book-photo-zoom { background: rgba(11,79,68,0.45); color: var(--white); }
.book-photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  color: var(--white);
  background: linear-gradient(transparent, rgba(11,79,68,0.85));
}
.book-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-500); }
.book-empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }

.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(11,26,23,0.92);
  z-index: 100;
  align-items: center; justify-content: center;
  flex-direction: column;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.lightbox-caption { color: var(--white); margin-top: 1rem; font-size: 0.95rem; text-align: center; max-width: 640px; }
.lightbox-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: none; border: none; color: var(--white);
  font-size: 2.5rem; line-height: 1; cursor: pointer;
}

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  .hero h1 { font-size: 1.8rem; }
  .site-header .container { justify-content: center; text-align: center; }
  .main-nav {
    /* .main-nav's default flex-wrap is nowrap, so on a narrow phone all 7
       links/buttons don't fit -- they used to just spill past the edge of
       the screen with no way to reach the hidden ones (nothing scrolled:
       not the nav, not even the page, since nothing declared an overflow
       behavior). Turn the nav strip itself into a horizontally swipeable
       scroller instead, and keep it left-aligned so it doesn't visually
       start mid-scroll. */
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.5rem; /* room for the scrollbar so it doesn't sit on top of the links */
  }
  .main-nav a { flex-shrink: 0; } /* don't let links squash instead of scrolling */
  .main-nav a.active::after { bottom: -0.3rem; } /* closer, now that scroll room ate into the gap below */
}
