/* =========================================
   IkramShop — Main Stylesheet
   ========================================= */

:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --light: #f8f9fa;
  --dark: #1a1a2e;
  --gray: #6c757d;
  --success: #27ae60;
  --border: #dee2e6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- TOP BAR TICKER ---- */
.topbar-ticker {
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.ticker-track {
  display: inline-flex;
  gap: 60px;
  animation: tickerScroll 28s linear infinite;
}
.ticker-track span {
  display: inline-block;
  padding: 0 30px;
  letter-spacing: .4px;
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.topbar-ticker:hover .ticker-track { animation-play-state: paused; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #fff;
  color: var(--secondary);
  line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar-brand {
  font-size: 1.6rem;
  font-weight: 800;
  color: #c9a24b !important;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.navbar-brand span { color: var(--secondary); }
.site-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c9a24b;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.site-logo-sm {
  width: 32px;
  height: 32px;
}
.nav-link { font-weight: 500; transition: color .2s; }
.nav-link:hover { color: var(--primary) !important; }
.cart-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  padding: 1px 6px;
  font-size: .75rem;
  margin-left: 3px;
  vertical-align: super;
}
.navbar { box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* ---- HERO ---- */
.hero-section {
  background-image:
    linear-gradient(160deg, rgba(20,14,10,.78) 0%, rgba(44,34,24,.72) 50%, rgba(180,60,40,.45) 100%),
    url('../../background.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Centered animated hero */
.hero-animated-center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px 16px;
  width: 100%;
}
.hero-brand-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 28px;
}
.hero-line-dec {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  display: block;
}
.hero-brand-name {
  font-size: clamp(2rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
  white-space: nowrap;
}
/* Cycling subtitles */
.hero-subtitle-wrap {
  position: relative;
  height: 2.6rem;
  margin-bottom: 40px;
}
.hero-sub {
  position: absolute;
  left: 0; right: 0;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(255,255,255,.82);
  opacity: 0;
  animation: heroSubCycle 9s infinite;
}
.hs1 { animation-delay: 0s; }
.hs2 { animation-delay: 3s; }
.hs3 { animation-delay: 6s; }
@keyframes heroSubCycle {
  0%   { opacity: 0; transform: translateY(10px); }
  8%   { opacity: 1; transform: translateY(0); }
  25%  { opacity: 1; transform: translateY(0); }
  33%  { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-10px); }
}
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-badge {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #c0392b;
  border-radius: 30px;
  padding: 5px 16px;
  font-size: .85rem;
  display: inline-block;
  margin-bottom: 20px;
}
.btn-hero {
  background: var(--primary);
  color: #fff;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  transition: all .3s;
  text-decoration: none;
  display: inline-block;
}
.btn-hero:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(231,76,60,.4); }
.btn-hero-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all .3s;
  text-decoration: none;
  display: inline-block;
}
.btn-hero-outline:hover { background: #fff; color: var(--secondary); }

/* ---- SECTION TITLES ---- */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
  text-align: center;
  margin-bottom: 10px;
}
.section-title span { color: var(--primary); }
.section-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 40px;
}
.section-divider {
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 12px auto 20px;
}

/* ---- PRODUCT CARD ---- */
.product-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all .3s;
  background: #fff;
  height: 100%;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 15px 40px rgba(0,0,0,.12); border-color: var(--primary); }
.product-card .card-img-top {
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}
.product-media {
  position: relative;
}
.product-img-placeholder {
  height: 220px;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #ccc;
}
.product-card .card-body { padding: 16px; }
.product-card .card-title { font-size: 1rem; font-weight: 700; color: var(--secondary); margin-bottom: 6px; }
.product-price { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.product-price-old { font-size: .9rem; color: var(--gray); text-decoration: line-through; margin-left: 8px; }
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.badge-sale { background: var(--primary); color: #fff; font-size: .75rem; padding: 3px 8px; border-radius: 4px; }
.badge-new { background: var(--success); color: #fff; font-size: .75rem; padding: 3px 8px; border-radius: 4px; }
.btn-add-cart {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .9rem;
  font-weight: 600;
  width: 100%;
  transition: all .3s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
}
.btn-add-cart:hover { background: var(--primary-dark); color: #fff; }

/* ---- CATEGORY CARD ---- */
.category-card {
  background: linear-gradient(135deg, var(--secondary), #34495e);
  color: #fff;
  border-radius: 12px;
  padding: 35px 20px;
  text-align: center;
  transition: all .3s;
  text-decoration: none;
  display: block;
}
.category-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,.2); color: #fff; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.category-card .icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-card h5 { font-weight: 700; margin: 0; }

/* ---- STATS BAR ---- */
.stats-bar { background: var(--secondary); color: #fff; padding: 30px 0; }
.stat-item { text-align: center; }
.stat-item h3 { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.stat-item p { margin: 0; opacity: .8; font-size: .9rem; }

/* ---- CART ---- */
.cart-item { border-bottom: 1px solid var(--border); padding: 15px 0; }
.cart-table th { background: var(--secondary); color: #fff; }
.qty-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.qty-input { width: 50px; text-align: center; border: 1px solid var(--border); border-radius: 6px; padding: 4px; }

/* ---- FORM STYLES ---- */
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(231,76,60,.2); }
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  transition: all .3s;
  cursor: pointer;
}
.btn-primary-custom:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---- FOOTER ---- */
footer { background: var(--dark); color: rgba(255,255,255,.75); }
footer h5 { color: #fff; font-weight: 700; margin-bottom: 16px; }
footer a { color: rgba(255,255,255,.6); text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; margin-top: 40px; text-align: center; font-size: .85rem; }
.social-icon { width: 38px; height: 38px; background: rgba(255,255,255,.1); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: all .3s; }
.social-icon:hover { background: var(--primary); }

/* ---- PAGE HEADER ---- */
.page-header {
  background: linear-gradient(135deg, var(--secondary), #16213e);
  color: #fff;
  padding: 50px 0;
  margin-bottom: 40px;
}
.page-header h1 { font-size: 2rem; font-weight: 800; margin: 0; }

/* ---- ALERTS ---- */
.alert { border-radius: 10px; border: none; }
.alert-success { background: rgba(39,174,96,.1); color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { background: rgba(231,76,60,.1); color: var(--primary); border-left: 4px solid var(--primary); }

/* ---- BREADCRUMB ---- */
.breadcrumb-item a { color: var(--primary); }

/* ---- ORDER STATUS ---- */
.status-en_attente { background: #fff3cd; color: #856404; }
.status-confirmee { background: #cff4fc; color: #055160; }
.status-en_livraison { background: #d1ecf1; color: #0c5460; }
.status-livree { background: #d4edda; color: #155724; }
.status-annulee { background: #f8d7da; color: #721c24; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 2rem; }
  .hero-section { padding: 60px 0 50px; }
  .hero-content-box { padding: 20px; }
}

/* ---- PRODUCT DETAIL ---- */
.product-detail-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  min-height: 350px;
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  color: #ccc;
  object-fit: cover;
}
.product-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 10px;
}
.product-carousel {
  position: relative;
  padding: 0 34px;
}
.product-carousel-control {
  width: 58px;
  height: 58px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .96);
  border-radius: 16px;
  opacity: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.product-carousel-control.carousel-control-prev {
  left: -6px;
}
.product-carousel-control.carousel-control-next {
  right: -6px;
}
.product-carousel-control:hover {
  background: var(--primary);
}
.product-carousel .carousel-control-prev-icon,
.product-carousel .carousel-control-next-icon {
  width: 18px;
  height: 18px;
  filter: invert(20%);
}
.product-carousel-control:hover .carousel-control-prev-icon,
.product-carousel-control:hover .carousel-control-next-icon {
  filter: invert(100%);
}
.product-carousel-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
}
.product-carousel-control:hover .product-carousel-label {
  color: #fff;
}
.product-thumb-btn {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
}
.product-thumb-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, .15);
}
.product-thumb-btn img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .product-carousel {
    padding: 0 18px;
  }

  .product-carousel-control {
    width: 48px;
    height: 48px;
  }

  .product-carousel-control.carousel-control-prev {
    left: -2px;
  }

  .product-carousel-control.carousel-control-next {
    right: -2px;
  }

  .product-carousel-label {
    font-size: .62rem;
  }
}
.product-meta span { font-size: .9rem; color: var(--gray); margin-right: 16px; }

/* ---- ACCOUNT ---- */
.auth-card { max-width: 480px; margin: 0 auto; border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.auth-logo { font-size: 2rem; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 30px; }
