/* resources/css/public.css */

/* Font */
@font-face {
  font-family: "Tajawal";
  src: url("/fonts/tajawal/Tajawal-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Default theme vars (used by other public pages later if they extend layout) */
:root {
  --brand: #3056ff;
  --brand-2: #314cb9;
  --accent: #f72585;
  --ink: #1f2937;
  --muted: #6b7280;

  /* Unified radius system */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Main public UI radiuses */
  --card-radius: var(--radius-lg);
  --surface-radius: var(--radius-lg);
  --control-radius: var(--radius-md);
  --hero-radius: var(--radius-xl);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="ar"] body {
  font-family: "Tajawal", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Shared UI */
.navbar {
  backdrop-filter: blur(8px);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--brand) !important;
}

.nav-link {
  color: #111827;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--brand);
}

.cardx {
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cardx:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
}

.thumb {
  height: 210px;
  width: 100%;
  object-fit: contain;
  background: #ffffff;
  padding: 10px;
  display: block;
}

@media (max-width: 768px) {
  .thumb { height: 190px; }
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
  border-radius: var(--control-radius);
  padding: 10px 14px;
  color: #ffffff;
}

.btn-brand:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #ffffff;
}

.muted { color: var(--muted); }

.pagination { justify-content: center; }

.page-link {
  border: none;
  border-radius: var(--control-radius) !important;
  margin: 0 3px;
  color: var(--brand);
  font-weight: 800;
}

.page-item.active .page-link { background: var(--brand); }

footer {
  background: #111827;
  color: #e5e7eb;
  margin-top: 3rem;
  padding: 2.75rem 0;
}

footer a {
  color: #e5e7eb;
  text-decoration: none;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* =========================
   Home page theme + sections
   ========================= */
body.theme-home {
  --brand: #3056ff;
  --brand-2: #314cb9;
  --accent: #f72585;
  --ink: #2f4462;
  --muted: #6b7280;
  --card-radius: var(--radius-lg);

  background: #f8fafc;
  color: var(--ink);
}

/* Compact tag stat */
.stat-tag {
  --cut: 16px;
  --hole: 15px;

  position: relative;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
  border-radius: 14px;

  padding: 14px 42px 14px 14px; /* LTR default */
  min-height: 72px;

  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

html[dir="ltr"] .stat-tag {
  clip-path: polygon(
    0% 0%,
    calc(100% - var(--cut)) 0%,
    100% 50%,
    calc(100% - var(--cut)) 100%,
    0% 100%
  );
}

html[dir="rtl"] .stat-tag {
  padding: 14px 14px 14px 42px;
  clip-path: polygon(
    var(--cut) 0%,
    100% 0%,
    100% 100%,
    var(--cut) 100%,
    0% 50%
  );
}

.stat-tag::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--hole);
  height: var(--hole);
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid rgba(15, 23, 42, .12);
}

html[dir="ltr"] .stat-tag::after { right: 12px; }
html[dir="rtl"] .stat-tag::after { left: 12px; }

.stat-tag .num {
  margin: 0;
  font-weight: 900;
  font-size: 1.55rem;
  color: var(--brand);
  line-height: 1;
}

.stat-tag .lbl {
  margin: 0;
  color: var(--muted);
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 768px) {
  .stat-tag {
    min-height: 66px;
    padding: 12px 40px 12px 12px;
  }
  html[dir="rtl"] .stat-tag { padding: 12px 12px 12px 40px; }
  .stat-tag .num { font-size: 1.4rem; }
  .stat-tag .lbl { font-size: .95rem; }
}

.hero {
  background:
    radial-gradient(1200px 400px at 20% 10%, rgba(255, 255, 255, .18), transparent 55%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  border-radius: 0 0 var(--hero-radius) var(--hero-radius);
  padding: 3.25rem 0;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero .hero-card {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--surface-radius);
  padding: 1.25rem;
}

.hero h1 {
  font-weight: 900;
  line-height: 1.25;
}

@media (max-width: 768px) {
  .hero { padding: 2.4rem 0; }
}

/* Badges */
.badge-featured {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(247, 37, 133, .28);
}

.badge-trending {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  background: #111827;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .24);
}

.badge-discount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e40a0a;
  color: #fff;
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 900;
  font-size: .95rem;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(239, 68, 68, .28);
}



.cat {
  background: #eef2ff;
  color: #3730a3;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .82rem;
  white-space: nowrap;
}

/* Filter box */
.filter {
  border-radius: var(--surface-radius);
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
}

.btn-soft {
  border-radius: var(--control-radius);
  font-weight: 800;
  padding: 10px 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  padding-bottom: .75rem;
  margin-bottom: 1rem;
}

.section-title h3 {
  margin: 0;
  font-weight: 900;
  font-size: 1.15rem;
}

/* Offer card internal layout */
.cardx .card-bodyx {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

.cardx .title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cardx .offer-title {
  font-weight: 900;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cardx .offer-desc {
  color: var(--muted);
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 72px;
}

.cardx .btn-row { margin-top: auto; }
.cardx .meta-row { margin-top: 12px; }

/* Quick filters pills */
.quick-filters .btn {
  border-radius: 999px !important;
  padding: 10px 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  border: 1px solid rgba(15, 23, 42, .12) !important;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.quick-filters .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .10);
  background: #f8fafc;
  border-color: rgba(15, 23, 42, .16) !important;
}

.quick-filters .btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(67, 97, 238, .28);
}

.quick-filters .btn-brand:hover {
  background: linear-gradient(135deg, var(--brand-2), var(--brand)) !important;
}

.quick-filters .btn-outline-secondary {
  border-color: rgba(15, 23, 42, .12) !important;
  color: #0f172a !important;
}

@media (max-width: 576px) {
  .quick-filters .btn {
    padding: 9px 12px;
    font-size: .92rem;
  }

  /* ==========================================
   Unified border radius for all public pages
   ========================================== */

/* Main surfaces / containers */
.cardx,
.filter,
.hero .hero-card,
.bg-white.rounded-4,
.border.rounded-4,
.rounded-4.shadow-sm,
.shadow-sm.border.overflow-hidden,
.alert,
.toast,
.modal-content,
.dropdown-menu,
.input-group-text,
.form-control,
.form-select {
  border-radius: var(--surface-radius) !important;
}

/* Buttons that should keep normal rounded corners */
.btn:not(.rounded-circle):not(.quick-filters .btn):not(.chip):not(.badge):not(.rounded-pill) {
  border-radius: var(--control-radius);
}

/* Quick filters and pills stay pill-shaped */
.quick-filters .btn,
.chip,
.badge.rounded-pill,
.rounded-pill,
.cat,
.badge-featured,
.badge-trending {
  border-radius: var(--radius-pill) !important;
}

/* Small badges with soft rounding */
.badge-discount {
  border-radius: var(--radius-sm);
}

/* Inputs and selects */
.form-control,
.form-select,
.input-group-text {
  border-radius: var(--control-radius) !important;
}

/* Public page content wrappers */
section.filter,
.cardx,
.bg-white.rounded-4,
.h-100.border.rounded-4,
.text-center.py-5.bg-white.rounded-4.border,
.bg-white.rounded-4.shadow-sm.border.overflow-hidden {
  border-radius: var(--surface-radius) !important;
  overflow: hidden;
}

/* Category images / visual boxes */
.public-icon-box,
.public-thumb-box {
  border-radius: var(--surface-radius) !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

.public-radius {
  border-radius: var(--surface-radius) !important;
}

.public-radius-sm {
  border-radius: var(--control-radius) !important;
}
}
