/* ==========================================================================
   No Samsar — Custom Styles (complément à Tailwind CSS)
   ========================================================================== */

:root {
  --brand-orange: #FF6B35;
  --brand-orange-dark: #E5542A;
  --brand-navy: #10192E;
  --brand-navy-light: #1C2942;
  --brand-green: #16A34A;
  --brand-gold: #F5B301;
}

* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background-color: #F6F7FB;
}
body.font-cairo, body.font-cairo * {
  font-family: 'Cairo', 'Inter', 'Segoe UI', sans-serif;
}
body.font-inter {
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ==========================================================================
   RTL Support (Arabic)
   ========================================================================== */
html[dir="rtl"] .fa-arrow-left {
  transform: scaleX(-1);
}
html[dir="rtl"] .card-img-wrap .absolute.top-3.left-3,
html[dir="rtl"] .card-img-wrap .absolute.top-4.left-4 {
  left: auto;
  right: 0.75rem;
}
html[dir="rtl"] .card-img-wrap .absolute.bottom-3.right-3 {
  right: auto;
  left: 0.75rem;
}
html[dir="rtl"] #header-search i,
html[dir="rtl"] #header-search-mobile i {
  left: auto;
  right: 0.9rem;
}
html[dir="rtl"] #header-search,
html[dir="rtl"] #header-search-mobile {
  padding-left: 1rem;
  padding-right: 2.5rem;
}
html[dir="rtl"] #bid-currency-label {
  right: auto;
  left: 1rem;
}
html[dir="rtl"] #bid-amount-input {
  padding-right: 1rem;
  padding-left: 4rem;
}
html[dir="rtl"] .ml-auto { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .breadcrumb-sep {
  transform: scaleX(-1);
}

/* ==========================================================================
   Language Switcher
   ========================================================================== */
.lang-switch {
  display: inline-flex;
  background: #F1F2F5;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #6B7280;
  transition: all 0.2s ease;
  cursor: pointer;
}
.lang-btn-active {
  background: #fff;
  color: var(--brand-orange-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #EDEEF3;
}
::-webkit-scrollbar-thumb {
  background: #C7CBD8;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-orange);
}

/* Logo mark */
.logo-mark {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-gold) 100%);
}

/* Hero banner */
.hero-banner {
  background: radial-gradient(circle at 15% 20%, rgba(255,107,53,0.35), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(245,179,1,0.25), transparent 45%),
              linear-gradient(120deg, var(--brand-navy) 0%, #182338 60%, var(--brand-navy-light) 100%) !important;
  color: #fff !important;
}
.hero-banner * {
  color: inherit;
}
.hero-banner .text-\[\#FF6B35\] {
  color: var(--brand-orange) !important;
}

.hero-pattern {
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-fees {
  background-color: #E7F7ED;
  color: var(--brand-green);
}
.badge-direct {
  background-color: #EAF1FF;
  color: #2563EB;
}
.badge-ending {
  background-color: #FFECEC;
  color: #DC2626;
  animation: pulse-badge 1.6s infinite;
}
.badge-ended {
  background-color: #F1F2F5;
  color: #6B7280;
}
.badge-new {
  background-color: #FFF6E5;
  color: #B7791F;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35); }
  50% { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}

/* Product card */
.product-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #EEEFF3;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px -14px rgba(16,25,46,0.22);
  border-color: #FFD9C4;
}
.product-card .card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #F1F2F5;
}
.product-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

/* Countdown chip */
.countdown-chip {
  font-family: 'Inter', monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Buttons */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  color: #fff;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.15s ease;
}
.btn-brand:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-brand:disabled {
  filter: grayscale(0.4);
  cursor: not-allowed;
  transform: none;
}

.btn-outline-brand {
  border: 1.5px solid var(--brand-orange);
  color: var(--brand-orange-dark);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-outline-brand:hover {
  background-color: var(--brand-orange);
  color: #fff;
}

/* Filter checkbox */
.filter-check {
  accent-color: var(--brand-orange);
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #EDEEF3 25%, #F6F7FB 37%, #EDEEF3 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Bid history row animation */
@keyframes flash-in {
  0% { background-color: #FFF3E8; }
  100% { background-color: transparent; }
}
.flash-new {
  animation: flash-in 1.8s ease;
}

/* Image dropzone */
.dropzone {
  border: 2px dashed #D7DAE3;
  border-radius: 16px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dropzone.dragover {
  border-color: var(--brand-orange);
  background-color: #FFF6F0;
}

/* Toast */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  min-width: 260px;
  max-width: 340px;
  background: #10192E;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.35);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.25s ease;
}
.toast.success { border-left: 4px solid var(--brand-green); }
.toast.error { border-left: 4px solid #DC2626; }
.toast.info { border-left: 4px solid #2563EB; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sticky bid box on product page */
.bid-box {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #EEEFF3;
  box-shadow: 0 10px 30px -12px rgba(16,25,46,0.12);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 0 rgba(22,163,74,0.5);
  animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* Uploader preview thumb */
.upload-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: #F1F2F5;
}
.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive helpers */
@media (max-width: 767px) {
  .hero-banner h1 {
    font-size: 2rem !important;
  }
}

/* ==========================================================================
   View Toggle (Grid / List)
   ========================================================================== */
.view-toggle-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #9AA1B0;
  transition: all 0.2s ease;
}
.view-toggle-btn.active {
  background: var(--brand-orange);
  color: #fff;
}

/* List view layout */
#product-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#product-grid.view-list .product-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
#product-grid.view-list .product-card .card-img-wrap {
  width: 220px;
  min-width: 220px;
  aspect-ratio: auto;
}
#product-grid.view-list .product-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 640px) {
  #product-grid.view-list .product-card {
    flex-direction: column;
  }
  #product-grid.view-list .product-card .card-img-wrap {
    width: 100%;
    min-width: 0;
    aspect-ratio: 4/3;
  }
}

/* ==========================================================================
   Featured Listings (Gold highlight)
   ========================================================================== */
.product-card.is-featured {
  border: 2px solid var(--brand-gold);
  box-shadow: 0 0 0 4px rgba(245, 179, 1, 0.12), 0 18px 38px -14px rgba(16,25,46,0.18);
  position: relative;
}
.badge-featured {
  background: linear-gradient(135deg, #FCE28A 0%, var(--brand-gold) 100%);
  color: #7A4E00;
  box-shadow: 0 2px 8px rgba(245,179,1,0.4);
}
.feature-cta-btn {
  border: 1.5px dashed var(--brand-gold);
  color: #B7791F;
  background: #FFFBEB;
  font-weight: 600;
  transition: all 0.2s ease;
}
.feature-cta-btn:hover {
  background: var(--brand-gold);
  color: #fff;
  border-style: solid;
}

/* ==========================================================================
   AdSense Slots
   ========================================================================== */
.ad-slot {
  position: relative;
  background: #F1F2F5;
  border: 1px dashed #C7CBD8;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9AA1B0;
  font-size: 12px;
  overflow: hidden;
  min-height: 90px;
}
.ad-slot::before {
  content: attr(data-ad-label);
  position: absolute;
  top: 4px;
  inset-inline-start: 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #B4B9C6;
  font-weight: 700;
}
.ad-slot-header { min-height: 90px; }
.ad-slot-infeed { min-height: 120px; grid-column: 1 / -1; }
.ad-slot-sidebar { min-height: 250px; }

/* ==========================================================================
   Modal (Feature Listing)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,25,46,0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-panel {
  background: #fff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 28px;
  text-align: center;
  animation: modal-pop 0.25s ease;
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Bid history table (transparent, replaces list on product page)
   ========================================================================== */
.bid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bid-table thead th {
  text-align: start;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9AA1B0;
  padding: 6px 8px;
  border-bottom: 1px solid #EEEFF3;
}
.bid-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #F6F7FB;
  color: #10192E;
}
.bid-table tbody tr.top-bid {
  background: #FFF6F0;
}

/* Winner banner */
.winner-banner {
  background: linear-gradient(135deg, #FCE28A 0%, var(--brand-gold) 100%);
  border-radius: 18px;
  padding: 20px;
  color: #5C3D00;
  text-align: center;
}
