/* ══════════════ ROOT COLORS ══════════════ */
:root {
  --orange:       #F5A623;
  --orange-dark:  #E67E00;
  --green:        #3DAA4B;
  --navy:         #2D3748;
  --light-bg:     #fff8ee;
  --white:        #ffffff;
}

/* ══════════════ BASE ══════════════ */
body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', sans-serif;
  color: var(--navy);
}
a { text-decoration: none; }

/* ══════════════ NAVBAR ══════════════ */
.custom-navbar {
  background: linear-gradient(90deg, var(--orange-dark), var(--orange)) !important;
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.custom-navbar .navbar-brand,
.custom-navbar .nav-link {
  color: #ffffff !important;
  font-weight: 500;
}
.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active {
  color: var(--navy) !important;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  padding-left: 10px;
  padding-right: 10px;
}
.custom-navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.7);
}
.custom-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%28255,255,255,0.9%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.navbar-logo {
  height: 48px;
  width: auto;
}

/* ══════════════ BUTTONS ══════════════ */
.btn-orange {
  background-color: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
}
.btn-orange:hover {
  background-color: var(--orange-dark);
  border-color: var(--orange-dark);
  color: #fff;
}
.btn-whatsapp {
  background-color: #25D366;
  border-color: #25D366;
  color: #fff;
  font-weight: 600;
}
.btn-whatsapp:hover {
  background-color: #1ebe5d;
  border-color: #1ebe5d;
  color: #fff;
}
.btn-login {
  background-color: rgba(255,255,255,0.15);
  border: 2px solid #fff;
  color: #fff;
  font-weight: 600;
}
.btn-login:hover {
  background-color: #fff;
  color: var(--orange-dark);
}
.btn-category {
  background-color: #fff;
  border: 2px solid var(--green);
  color: var(--green);
  font-weight: 500;
  border-radius: 20px;
  padding: 6px 16px;
  transition: all 0.25s ease;
}
.btn-category:hover,
.btn-category.active {
  background-color: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* ══════════════ HERO ══════════════ */
.hero-section {
  background: linear-gradient(135deg, var(--light-bg), #ffe5b4);
  padding: 70px 0 50px;
  border-bottom: 3px solid var(--orange);
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.hero-title span {
  color: var(--orange-dark);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: #555;
  margin: 15px 0 25px;
}
.hero-logo-wrapper {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(245,166,35,0.25);
  display: inline-block;
}
.hero-logo-img {
  max-width: 260px;
  width: 100%;
}

/* ══════════════ SECTION HEADERS ══════════════ */
.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
}

/* ══════════════ PRODUCT CARDS ══════════════ */
.product-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(245,166,35,0.25);
}
.card-img-top-wrapper {
  height: 200px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  padding: 0;
  position: relative;
  cursor: pointer;
}
.card-img-top-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img-top-wrapper img {
  transform: scale(1.08);
}
.card-img-top-wrapper::after {
  content: '\F52A';
  font-family: 'bootstrap-icons';
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.85rem;
  padding: 4px 7px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.product-card:hover .card-img-top-wrapper::after {
  opacity: 1;
}

.card-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 4px;
}
.card-text {
  font-size: 0.78rem;
  color: #777;
  line-height: 1.3;
}
.product-brand {
  font-size: 0.72rem;
  color: var(--orange-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.price-wrapper {
  display: flex;
  flex-direction: column;
}
.original-price {
  font-size: 0.78rem;
  color: #aaa;
  text-decoration: line-through;
}
.discount-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange-dark);
}
.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--orange-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 2;
}
.out-of-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 2;
}

/* ══════════════ ABOUT SECTION ══════════════ */
.about-section {
  background: var(--light-bg);
  border-top: 3px solid var(--orange);
  border-bottom: 3px solid var(--orange);
}
.about-logo-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 30px rgba(245,166,35,0.2);
}

/* ══════════════ FOOTER ══════════════ */
.custom-footer {
  background: linear-gradient(90deg, var(--orange-dark), var(--orange)) !important;
  color: #ffffff;
}
.footer-heading {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 15px;
  color: #fff;
  border-bottom: 2px solid rgba(255,255,255,0.3);
  padding-bottom: 8px;
}
.footer-text {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.footer-links a {
  color: rgba(255,255,255,0.85);
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--navy);
}
.footer-divider {
  border-color: rgba(255,255,255,0.3);
}
.footer-copy {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}

/* ══════════════ AUTH PAGES ══════════════ */
.auth-body {
  background: linear-gradient(135deg, #fff8ee, #ffe5b4);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-wrapper {
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
}
.auth-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 35px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(245,166,35,0.2);
  border-top: 4px solid var(--orange);
}

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 991.98px) {
  .hero-title { font-size: 2rem; }
  .custom-navbar .navbar-collapse {
    background: var(--orange-dark);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
  }
}
@media (max-width: 575.98px) {
  .hero-title { font-size: 1.6rem; }
  .hero-section { padding: 40px 0 30px; }
  .card-img-top-wrapper { height: 140px; }
}
/* ══════════════ ADMIN LAYOUT ══════════════ */
.admin-body {
  background: #f4f6f9;
  margin: 0;
  padding: 0;
}
.admin-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: 100vh;
  background: var(--navy);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand-text {
  color: var(--orange);
  font-weight: 800;
  font-size: 1.2rem;
}
.sidebar-user {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-nav {
  padding: 15px 0;
  flex: 1;
}
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  padding: 10px 20px 5px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-left-color: var(--orange);
}
.sidebar-link.active {
  background: rgba(245,166,35,0.15);
  color: var(--orange);
  border-left-color: var(--orange);
  font-weight: 600;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* TOPBAR */
.admin-main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--navy);
  display: none;
  cursor: pointer;
}
.topbar-title {
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}
.topbar-right {
  display: flex;
  gap: 8px;
}

/* CONTENT */
.admin-content {
  padding: 25px;
  flex: 1;
}
.admin-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

/* STAT CARDS */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff;
  margin: 0 auto 10px;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
}
.stat-label {
  font-size: 0.78rem;
  color: #888;
  font-weight: 500;
}

/* USER AVATAR */
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* TABLE */
.admin-table thead th {
  background: var(--light-bg);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
}
.admin-table td {
  vertical-align: middle;
  font-size: 0.85rem;
  border-color: #f0f0f0;
}

/* BADGE VARIANTS */
.badge-orange { background-color: var(--orange); color: #fff; }
.badge-green  { background-color: var(--green);  color: #fff; }

/* BUTTON VARIANTS */
.bg-orange { background-color: var(--orange) !important; }
.bg-green  { background-color: var(--green)  !important; }
.bg-navy   { background-color: var(--navy)   !important; }
.text-orange { color: var(--orange) !important; }
.btn-outline-orange {
  border-color: var(--orange);
  color: var(--orange);
}
.btn-outline-orange:hover {
  background: var(--orange);
  color: #fff;
}
.btn-outline-green {
  border-color: var(--green);
  color: var(--green);
}
.btn-outline-green:hover {
  background: var(--green);
  color: #fff;
}

/* RESPONSIVE ADMIN */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: block;
  }
}
/* ══════════════ PRICE PREVIEW BOX ══════════════ */
.price-preview-box {
  background: var(--light-bg);
  border: 2px solid var(--orange);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--navy);
}
.price-preview-box strong { color: var(--orange-dark); }

/* ══════════════ SETTINGS PREVIEW CARDS ══════════════ */
.preview-price-card {
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
}
.preview-price-card.border-orange { border-color: var(--orange); }
.preview-price-card.border-green  { border-color: var(--green);  }
.preview-price-card.border-navy   { border-color: var(--navy);   }
.preview-role {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 5px;
}
.preview-val {
  font-size: 1.1rem;
  font-weight: 800;
}
.preview-discount {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 3px;
}
/* ══════════════ ROLE BANNERS ══════════════ */
.role-banner {
  padding: 8px 0;
  font-size: 0.9rem;
  text-align: center;
}
.wholesaler-banner {
  background: linear-gradient(90deg, #1a5c2a, #3DAA4B);
  color: #fff;
}
.retailer-banner {
  background: linear-gradient(90deg, #c45f00, #F5A623);
  color: #fff;
}

/* ══════════════ SEARCH BAR ══════════════ */
.search-form { width: 100%; max-width: 420px; }
.search-bar-group { border-radius: 25px; overflow: hidden; }
.search-input {
  border: none;
  background: rgba(255,255,255,0.95);
  padding-left: 16px;
}
.search-input:focus { box-shadow: none; }
.btn-search {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0 14px;
}
.btn-search:hover { background: var(--orange-dark); color: #fff; }
.btn-search-clear {
  background: #dc3545;
  color: #fff;
  border: none;
  padding: 0 12px;
}
.btn-search-clear:hover { background: #b02a37; color: #fff; }

/* ══════════════ CART BUTTON ══════════════ */
.btn-cart {
  background: rgba(255,255,255,0.15);
  border: 2px solid #fff;
  color: #fff;
  font-weight: 600;
  padding-right: 22px;
}
.btn-cart:hover { background: #fff; color: var(--orange-dark); }
.cart-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ══════════════ PRODUCT CODE BADGE ══════════════ */
.product-code-badge {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 6px;
  font-family: monospace;
}

/* ══════════════ ROLE SAVING ══════════════ */
.role-saving {
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 600;
}

/* ══════════════ CART PAGE ══════════════ */
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.cart-item-img {
  flex-shrink: 0;
  width: 65px;
  height: 65px;
}
.cart-item-img img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #eee;
  display: block;
}

.cart-item-info { flex: 1; min-width: 120px; }
.cart-item-name { font-weight: 600; font-size: 0.88rem; color: var(--navy); }
.cart-item-code { font-size: 0.75rem; color: #888; font-family: monospace; }
.cart-item-saving { font-size: 0.72rem; color: var(--green); font-weight: 600; }
.cart-item-qty { min-width: 110px; }
.qty-group input { max-width: 50px; }
.cart-item-price { min-width: 110px; text-align: right; }
.cart-item-remove { }

/* CART SUMMARY */
.cart-summary-card { position: sticky; top: 80px; }
.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.total-line {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ══════════════ MOBILE CART ══════════════ */
@media (max-width: 575.98px) {
  .cart-item-row { gap: 8px; }
  .cart-item-price { min-width: 80px; }
  .search-form { max-width: 100%; }
}
/* ══════════════ CATEGORY BADGE LINK ══════════════ */
.product-cat-link {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 20px;
  padding: 1px 8px;
  margin-bottom: 5px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.product-cat-link:hover {
  background: var(--green);
  color: #fff;
}
.product-cat-link i { font-size: 0.68rem; }

/* ══════════════ LIGHTBOX MODAL ══════════════ */
.lightbox-modal .modal-dialog {
  max-width: 860px;
}
.lightbox-modal .modal-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.lightbox-modal .modal-body {
  padding: 0;
}
.lightbox-img-col {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 20px;
}
.lightbox-img-col img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox-info-col {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.lightbox-brand {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.lightbox-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 8px;
}
.lightbox-code {
  font-size: 0.78rem;
  color: #888;
  font-family: monospace;
  margin-bottom: 10px;
}
.lightbox-description {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 16px;
}
.lightbox-price-original {
  font-size: 0.88rem;
  color: #aaa;
  text-decoration: line-through;
}
.lightbox-price-main {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--orange-dark);
  line-height: 1.1;
}
.lightbox-saving {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 16px;
}
.lightbox-cat-link {
  font-size: 0.78rem;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 20px;
  padding: 2px 10px;
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
  transition: all 0.2s;
  align-self: flex-start;
}
.lightbox-cat-link:hover {
  background: var(--green);
  color: #fff;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(0,0,0,0.8); }

/* Mobile lightbox */
@media (max-width: 767.98px) {
  .lightbox-img-col {
    min-height: 220px;
    padding: 15px;
  }
  .lightbox-img-col img { max-height: 220px; }
  .lightbox-info-col { padding: 18px; }
  .lightbox-price-main { font-size: 1.3rem; }
}