/* ================================
   BHD Store — Brand UI System
   Clean, Consistent, Bootstrap-friendly
   ================================ */

/* 1) Brand Tokens */
:root{

--brand-primary: #2B2B2B;
--brand-primary-dark: #111111;
--brand-accent: #C62828;   /* الأحمر يبقى */




  --bg: #F7F7F7;
  --surface: #FFFFFF;

  --text: #1F1F1F;
  --muted: #6C757D;

  --border: #E3E3E3;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 12px 30px rgba(0,0,0,0.18);

  --focus-ring: 0 0 0 0.15rem rgba(239,108,0,.18);
}

/* 2) Base */
body{
  background-color: var(--bg);
  color: var(--text);
  padding-bottom: 80px; /* علشان شريط السلة تحت ما يغطي المحتوى */
  font-family: 'Cairo','Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* Headings */
h1,h2,h3,h4,h5,h6{
  color: var(--text);
  font-weight: 700;
}
.small,.text-muted{ color: var(--muted) !important; }

/* 3) Bootstrap Overrides (controlled) */
/* Navbar / bg-dark in your project is orange */
.bg-dark{
  background-color: var(--brand-primary) !important;
}

/* Replace "primary" feel across UI without breaking bootstrap layout */
.btn-primary,
.btn-success{
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 10px;
}
.btn-primary:hover,
.btn-success:hover{
  background: var(--brand-primary-dark) !important;
  border-color: var(--brand-primary-dark) !important;
}

/* Danger stays for delete/errors */
.btn-danger{
  background: var(--brand-accent) !important;
  border-color: var(--brand-accent) !important;
  font-weight: 700;
  border-radius: 10px;
}

/* 4) Logos */
.head-logo{ width: 180px; }
.body-logo{ width: 550px; max-width: 100%; }
.thank-logo{ width: 150px; }

/* 5) Product Card / List */
.product-card{
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.badge-unit{ font-size: .75rem; }

.category-title{
  border-right: 4px solid var(--brand-primary);
  padding-right: 10px;
  margin-top: 25px;
  margin-bottom: 15px;
}

/* Product row layout */
.product-row{
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.product-info{ flex: 1; }
.product-thumb{
  width: 115px;
  height: 115px;
  object-fit: cover;
  border-radius: 10px;
  background-color: #f2f2f2;
  border: 1px solid var(--border);
}

/* Pricing */
.price-old{
  text-decoration: line-through;
  opacity: .6;
}

/* 6) Cart Icon Button + Badge */
.cart-item-name{ min-width: 0; }

.cart-icon-btn{
  position: relative;
  --bs-btn-padding-x: 0.55rem;
  --bs-btn-padding-y: 0.05rem;
  background-color: var(--brand-primary);
  color: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
}
.cart-icon-btn:hover{
  background-color: var(--brand-primary-dark);
}
.cart-badge{
  position: absolute;
  font-size: 0.7rem;
}

/* 7) Bottom Cart Bar */
.cart-bottom-bar{
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: none; /* تظهر فقط إذا في أصناف */
  z-index: 1030;
  box-shadow: 0 -6px 18px rgba(0,0,0,.06);
}
.cart-items-list{
  max-height: 260px;
  overflow-y: auto;
}

/* 8) Quantity Control */
.qty-circle-group{
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.qty-circle-btn,
.qty-circle-value{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background-color: var(--surface);
  color: var(--text);
  padding: 0;
}
.qty-circle-btn{
  cursor: pointer;
  user-select: none;
}
.qty-circle-btn:active{ transform: scale(0.96); }
.qty-circle-value{
  font-size: 14px;
  border-width: 1px;
}

/* 9) Cart Modal */
#cartModal .modal-content{
  border-radius: var(--radius-lg);
  border: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Header */
#cartModal .modal-header{
  background: var(--brand-primary);
  color: #fff;
  border-bottom: 0;
  padding: 12px 16px;
}
#cartModal .modal-title{
  font-size: 1.05rem;
  font-weight: 800;
  color: white !important;
}
#cartModal .btn-close{
  filter: invert(1);
  opacity: .85;
}
#cartModal .btn-close:hover{ opacity: 1; }

/* Body */
#cartModal .modal-body{
  background: #f8f9fb;
  padding: 16px 18px;
}
#cartModal .modal-body h6{
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

/* Items box */
#cartItemsModal{
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 10px 12px;
}
#cartItemsModal > div{
  background: #fafafa;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.03);
}

/* Total row */
#cartModal .d-flex.justify-content-between.mb-3{
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px 12px;
  margin-top: 5px;
}
#cartTotalModal{
  font-size: 1rem;
  color: var(--brand-primary);
  font-weight: 900;
}

/* Form controls */
#cartModal .form-label{
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 3px;
  font-weight: 700;
}
#cartModal .form-control,
#cartModal .form-select{
  border-radius: 10px;
  border-color: #d5d5d5;
  font-size: 0.95rem;
}
#cartModal .form-control:focus,
#cartModal .form-select:focus{
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}

/* Footer */
#cartModal .modal-footer{
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
}
#cartModal .modal-footer .btn-success{
  min-width: 130px;
  font-weight: 900;
}

/* Mobile tweaks */
@media (max-width: 576px){
  #cartModal .modal-dialog{ margin: 10px; }
  #cartModal .modal-body{ padding: 12px 12px; }
  .body-logo{ width: 100%; }
}

/* 10) Loading Overlay */
#loadingOverlay{
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#loadingOverlay.hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

/* Spinner */
.loading-spinner{
  width: 60px;
  height: 60px;
  border: 5px solid #eee;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin{ to { transform: rotate(360deg); } }
.loading-text{
  font-size: 14px;
  color: #555;
  font-weight: 700;
}

/* 11) Promo Banner */
.promo-banner-img{
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
@media (max-width: 576px){
  .promo-banner-img{ max-height: 140px; }
}

/* 12) Success Box */
#orderSuccessBox{
  max-width: 500px;
  margin: 20px auto;
  background: var(--brand-primary);
  color: #fff;
  padding: 15px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  direction: rtl;
}
#orderSuccessBox strong{
  font-size: 18px;
}

/* 13) Toast */
.toast-message{
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--brand-accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  z-index: 99999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  transform: translateY(10px);
  font-weight: 800;
}
.toast-message.show{
  opacity: 1;
  transform: translateY(0);
}


/* زر السلة */
.cart-btn{
  position: relative;
  background: transparent;      /* 👈 أهم فرق */
  border: none;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* أيقونة السلة */
.cart-icon{
  width: 30px;
  height: 30px;
  color: #ffffff;               /* لو الهيدر غامق */
  /* color: #333; */             /* لو الهيدر فاتح */
}

/* عدّاد السلة */
.cart-count{
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ffffff;
  color: #000;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.cart-icon-btn{
  position: relative;
  background: transparent !important;
  border: none !important;
  padding: 6px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
}

/* لو العداد القديم يعتمد cart-badge + d-none */
.cart-badge{
  position: absolute !important;
  top: -4px !important;
  right: -6px !important;
  font-size: 11px !important;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* لو بعض الأماكن تستخدم Bootstrap bg-danger للعداد */
.badge.bg-danger{
  background: #fff !important;
  color: #000 !important;
}

/* تصحيح أي عناصر تأثرت من تغييرات عامة */
.product-card{ height: 100%; }        /* كانت موجودة بالأصلي */
.badge-unit{ font-size: .75rem; }     /* كانت موجودة بالأصلي */
.cart-item-name{ min-width: 0; }      /* كانت موجودة بالأصلي */

/* تأكد إن شريط السلة السفلي ما ينهار لو كان معتمد على display */
.cart-bottom-bar{
  background: var(--surface, #fff);
  border-top: 1px solid var(--border, #e3e3e3);
}

/* لو كان في عناصر تعتمد على bg-dark = لون الهيدر */
.bg-dark{
  background-color: var(--brand-primary, #1E1E1E) !important;
}

.seo-text{
  position: absolute;
/*  left: -9999px; */
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.header-icons .header-link {
  font-size: 1.2rem;
  opacity: 0.85;
  transition: 0.2s ease;
}

.header-icons .header-link:hover {
  opacity: 1;
  transform: scale(1.1);
}


/* ================================
   Special Offer (Discounted Products)
   ================================ */

/* الكرت المخصوم */
.product-card.has-discount{
  border: 2px solid var(--brand-accent);
  background: linear-gradient(180deg, #fffafa, #ffffff);
  position: relative;
}

/* بادج عرض خاص */
.product-card.has-discount .badge-offer{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  background: var(--brand-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  letter-spacing: 0.2px;
}

/* تحسين السعر الجديد */
.product-card.has-discount .price-new{
  color: var(--brand-accent);
  font-size: 15px;
  font-weight: 900;
}

/* السعر القديم */
.product-card.has-discount .price-old{
  text-decoration: line-through;
  opacity: 0.55;
  font-weight: 600;
}
.contact-fab{

  background:#ffc107;
  color:#000;
  border:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1055;
}

#contactModal .modal-title{
  font-size: 1.05rem;
  font-weight: 800;
  color: white !important;
}

#contactModal .btn btn-warning{
  min-width: 130px;
  font-weight: 900;
}

#contactModal .modal-body{
  background: #f8f9fb;
  padding: 16px 18px;
}


/* Checkout layout */
.checkout-shell {
  max-width: 920px;
}

/* Section titles */
.section-title {
  font-weight: 800;
}

/* Key-value rows */
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(0,0,0,.08);
}
.kv:last-child {
  border-bottom: 0;
}

/* Muted text */
.muted {
  color: #6c757d;
}

/* Money alignment */
.money {
  font-variant-numeric: tabular-nums;
}

/* Preserve line breaks for address / notes */
.address-pre {
  white-space: pre-line;
}

/* Table column widths */
.col-qty   { width: 60px; }
.col-price { width: 90px; }
.col-total { width: 110px; }

/* Sticky confirm button */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(248,249,250,.92);
  border-top: 1px solid rgba(0,0,0,.08);
}

/* Checkout checkbox validation */
.form-check-input.is-invalid {
  border-color: #dc3545;
}

.form-check-input.is-invalid:checked {
  background-color: #dc3545;
  border-color: #dc3545;
}

.form-check-input.is-invalid ~ .form-check-label {
  color: #dc3545;
  font-weight: 600;
}


/* Checkout title inside #checkoutWrap */
.checkout-title-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.checkout-title{
  font-size:1.6rem;
  font-weight:800;
  line-height:1.2;
  margin:0;
}

.checkout-subtitle{
  font-size:.95rem;
  color:rgba(0,0,0,.55);
  margin-top:4px;
}

.checkout-minimum-order{
  font-size:.95rem;
  color:rgba(229, 27, 0, 0.9);
  margin-top:4px;
}

/* Add-to-cart micro interactions */
@keyframes btnPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.92); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.js-add.is-added {
  animation: btnPop 280ms ease;
}

@keyframes cartBump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.cart-bump {
  animation: cartBump 360ms ease;
}

/* زر الإضافة: حركة ضغط بسيطة */
@keyframes btnPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.92); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.js-add.is-added {
  animation: btnPop 280ms ease;
}

/* علامة صح خضراء فوق الزر */
.js-add {
  position: relative; /* ضروري للـ ::after */
  overflow: visible;
}

/* زر الإضافة: حركة ضغط بسيطة */
@keyframes btnPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.92); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.js-add.is-added { animation: btnPop 280ms ease; }

.js-add { position: relative; }

/* علامة صح داخل الزر */
.js-add .btn-checkmark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.js-add .btn-checkmark i {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #198754;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.20);
  transform: scale(.6);
}

/* أنيميشن الصح */
@keyframes checkIn {
  0%   { opacity: 0; transform: translateY(8px) scale(.6); }
  35%  { opacity: 1; transform: translateY(0) scale(1.1); }
  65%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(.95); }
}

.js-add.show-check .btn-checkmark {
  animation: checkIn 950ms ease forwards;
  opacity: 1;
}
.js-add.show-check .btn-checkmark i { transform: none; }


