:root {
  --primary: #0869A6;
  --primary-light: #0879A6;
  --secondary: #39a3cd;
  --dark: #0d1b2e;
  --light: #f0f4f8;
  --white: #ffffff;
  --success: #22c55e;
  --danger: #ef4444;
  --text: #333333;
  --text-muted: #666666;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: #f5f5f5;
  color: var(--text);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.topbar {
  background: var(--primary);
  padding: 8px 0;
  color: var(--white);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
}

.topbar__right {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.topbar__right a {
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__right a:hover {
  color: rgba(255,255,255,0.8);
}

.main-menu {
  background: var(--white);
  padding: 15px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-menu .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 60px;
  object-fit: contain;
}

.main-menu__list {
  display: flex;
  list-style: none;
  gap: 30px;
}

.main-menu__list a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.main-menu__list a:hover,
.main-menu__list a.active {
  color: var(--primary);
}

.main-header__info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-header__info a {
  color: var(--dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 8px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Main Layout */
.container-fluid {
  padding: 20px;
}

.main-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 8px;
}

.category-list a {
  display: block;
  padding: 10px 15px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
}

.category-list a:hover,
.category-list a.active {
  background: var(--primary);
  color: var(--white);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-box button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Section Header */
.section-header {
  background: var(--primary);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.section-header h2 {
  color: var(--white);
  font-size: 20px;
  margin: 0;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-image {
  height: 200px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image .emoji {
  font-size: 60px;
}

.badge-promo {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-devis {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--dark);
  color: var(--secondary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.product-body {
  padding: 15px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.product-specs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.price-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.add-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover {
  background: var(--primary-light);
}

.add-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Drawer / Cart */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1000;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  background: var(--white);
  transform: translateX(100%);
  transition: transform 0.3s;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h3 {
  font-size: 18px;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-price {
  color: var(--text-muted);
  font-size: 13px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 18px;
}

.drawer-footer {
  padding: 20px;
  border-top: 1px solid #eee;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 700;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: var(--primary-light);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.order-summary {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.order-item-row.total {
  font-weight: 700;
  border-top: 1px solid #ddd;
  padding-top: 8px;
  margin-top: 8px;
}

.order-number-display {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
}

.order-number-label {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  margin-bottom: 8px;
}

.order-number-value {
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}

.confirm-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.confirm-btn:hover {
  background: var(--primary-light);
}

/* Success Screen */
.success-screen {
  text-align: center;
  padding: 30px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: white;
}

.success-title {
  font-size: 24px;
  margin-bottom: 10px;
}

.success-message {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.whatsapp-btn:hover {
  background: #20BD5A;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: var(--white);
  padding: 50px 0 0;
  margin-top: auto;
}

.site-footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.footer-widget__title {
  color: var(--white);
  font-size: 18px;
  margin-bottom: 20px;
}

.footer-widget ul {
  list-style: none;
}

.footer-widget ul a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  display: block;
  padding: 5px 0;
  transition: color 0.2s;
}

.footer-widget ul a:hover {
  color: var(--white);
}

.footer-widget__contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
}

.footer-widget__contact a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

.footer-widget__contact a:hover {
  color: var(--white);
}

.bottom-footer {
  background: rgba(0,0,0,0.2);
  padding: 15px 0;
  text-align: center;
  margin-top: 30px;
}

.bottom-footer p {
  color: rgba(255,255,255,0.8);
  margin: 0;
  font-size: 13px;
}

/* Mobile */
.mobile-nav__toggler {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 991px) {
  .main-menu__list {
    display: none;
  }
  
  .mobile-nav__toggler {
    display: block;
  }
  
  .main-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .drawer {
    width: 100%;
  }
  
  .topbar {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}