/* =========================================================
   BOUTIQUE E-COMMERCE - STYLE.CSS
   Couleurs : Primaire #2563eb / Secondaire #0f172a / Accent #f97316 / Fond #f8fafc
   ========================================================= */

:root {
    --primary: #2563eb;
      --primaryR: #ef4444;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #f97316;
    --bg: #f8fafc;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 14px 32px rgba(15, 23, 42, 0.14);
    --transition: all 0.25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--secondary);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm); border: none;
    font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-add-cart { width: 100%; border-radius: 0 0 var(--radius) var(--radius); background: var(--secondary); color: #fff; padding: 12px; }
.btn-add-cart:hover { background: var(--accent); }
.btn-add-cart:disabled { background: var(--gray-400); cursor: not-allowed; }

/* ---------- HEADER ---------- */
.site-header {
    background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 20px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.main-nav ul { display: flex; gap: 22px; }
.main-nav a { font-weight: 600; color: var(--secondary); transition: var(--transition); padding: 6px 0; }
.main-nav a:hover { color: var(--primary); }
.dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 200px;
    box-shadow: var(--shadow); border-radius: var(--radius-sm); padding: 8px 0; z-index: 50;
}
.dropdown-menu li a { display: block; padding: 8px 16px; }
.dropdown-menu li a:hover { background: var(--gray-100); }
.dropdown:hover .dropdown-menu { display: block; }

.header-search { position: relative; flex: 1; max-width: 320px; display: flex; }
.header-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 999px; outline: none; }
.header-search button { background: none; border: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 16px; }
.live-search-results {
    position: absolute; top: 110%; left: 0; right: 0; background: #fff; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover); display: none; z-index: 60; overflow: hidden;
}
.live-search-results.active { display: block; }
.live-search-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--gray-100); }
.live-search-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.live-search-item:hover { background: var(--gray-100); }

.cart-link { position: relative; font-size: 22px; }
.cart-count {
    position: absolute; top: -8px; right: -10px; background: var(--accent); color: #fff;
    font-size: 11px; padding: 2px 6px; border-radius: 999px; font-weight: 700;
}
.burger { display: none; font-size: 26px; background: none; border: none; cursor: pointer; }

/* ---------- HERO ---------- */
.hero { background: linear-gradient(135deg, var(--secondary), #1e293b); color: #fff; padding: 70px 0; overflow: hidden; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero-text { max-width: 560px; }
.hero-text h1 { font-size: 42px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-text h1 span { color: var(--accent); }
.hero-text p { color: var(--gray-200); margin-bottom: 26px; font-size: 16px; }
.hero-image { position: relative; width: 260px; height: 260px; display: flex; align-items: center; justify-content: center; }
.hero-shape { position: absolute; width: 260px; height: 260px; background: var(--accent); opacity: .2; border-radius: 50%; animation: pulse 3s infinite; }
.hero-emoji { font-size: 120px; z-index: 2; }
@keyframes pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.08);} }

/* ---------- SECTIONS ---------- */
.section { padding: 60px 0; }
.section-alt { background: var(--gray-100); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.section-head h2 { font-size: 28px; font-weight: 800; }
.see-all { color: var(--primary); font-weight: 600; }

/* ---------- PRODUCT GRID / CARD ---------- */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.product-card-img { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--gray-100); }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.product-card:hover .product-card-img img { transform: scale(1.07); }
.badge-promo, .badge-stock {
    position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge-stock { background: var(--secondary); left: auto; right: 10px; }
.product-card-body { padding: 16px; flex: 1; }
.product-card-title { font-size: 16px; font-weight: 700; margin: 4px 0; }
.product-card-desc { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; }
.product-card-price { display: flex; gap: 8px; align-items: baseline; }
.price-now { font-size: 18px; font-weight: 800; color: var(--primaryR); }
.price-old { font-size: 13px; color: var(--gray-400); text-decoration: line-through; }

/* ---------- FEATURES ---------- */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.feature-item { background: #fff; padding: 28px 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.feature-item span { font-size: 32px; }
.feature-item h4 { margin: 10px 0 6px; }
.feature-item p { font-size: 13px; color: var(--gray-600); }

/* ---------- CATALOGUE ---------- */
.catalogue-header { margin-bottom: 24px; }
.catalogue-header h1 { font-size: 30px; font-weight: 800; }
.catalogue-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }
.catalogue-filters { background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); align-self: start; }
.filter-block { margin-bottom: 22px; }
.filter-block h4 { margin-bottom: 10px; font-size: 15px; }
.filter-list a { display: block; padding: 6px 0; font-size: 14px; color: var(--gray-600); }
.filter-list a:hover, .filter-list a.active { color: var(--primary); font-weight: 700; }
.catalogue-filters select { width: 100%; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }

/* ---------- PAGINATION ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.page-link {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); font-weight: 600;
}
.page-link.active { background: var(--primary); color: #fff; }

/* ---------- BREADCRUMB ---------- */
.breadcrumb { font-size: 13px; color: var(--gray-600); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary); }

/* ---------- PRODUCT DETAIL ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.gallery-main { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; cursor: zoom-in; }
.gallery-main img { width: 100%; aspect-ratio: 1/1; object-fit: cover; transition: transform .3s; }
.gallery-main.zoom-active img { transform: scale(1.8); cursor: zoom-out; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; }
.gallery-thumb.active { border-color: var(--primary); }
.product-video { margin-top: 24px; }
.video-wrapper { position: relative; padding-bottom: 56.25%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-wrapper iframe { position: absolute; top:0; left:0; width: 100%; height: 100%; border: 0; }

.product-cat-tag { display: inline-block; background: var(--gray-100); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.product-info h1 { font-size: 28px; font-weight: 800; margin: 6px 0; }
.product-ref { color: var(--gray-600); font-size: 13px; margin-bottom: 14px; }
.product-price-block { display: flex; gap: 12px; align-items: baseline; margin-bottom: 14px; }
.product-price-block .price-now { font-size: 28px; }
.product-stock { font-weight: 600; margin-bottom: 16px; }
.in-stock { color: #16a34a; } .out-stock { color: #dc2626; }
.product-short-desc { margin-bottom: 20px; color: var(--gray-600); }

.add-to-cart-block { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.qty-selector { display: flex; align-items: center; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; }
.qty-selector button { width: 36px; height: 40px; border: none; background: var(--gray-100); cursor: pointer; font-size: 16px; }
.qty-selector input { width: 50px; text-align: center; border: none; height: 40px; font-size: 15px; }

.share-buttons { display: flex; align-items: center; gap: 10px; }
.share-btn { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: #fff; }
.share-fb { background: #1877f2; } .share-wa { background: #25d366; } .share-ig { background: #e1306c; }

.product-full-desc { margin-top: 50px; }
.product-full-desc h2 { margin-bottom: 14px; font-size: 22px; }

/* ---------- CART / CHECKOUT ---------- */
.cart-table-wrapper { overflow-x: auto; }
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--gray-100); }
.cart-product-cell { display: flex; align-items: center; gap: 12px; }
.cart-product-cell img { width: 50px; height: 50px; object-fit: cover; border-radius: var(--radius-sm); }
.btn-remove { background: none; border: none; cursor: pointer; font-size: 18px; }
.cart-summary { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.cart-total-line { font-size: 20px; margin-right: auto; }

.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }
.checkout-form, .checkout-summary { background: #fff; padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); }
.checkout-form label, .product-form label, .login-box label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.checkout-form input, .checkout-form textarea,
.product-form input, .product-form textarea, .product-form select,
.login-box input, .contact-form-wrapper input, .contact-form-wrapper textarea {
    width: 100%; padding: 11px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
}
.checkout-items { margin: 16px 0; }
.checkout-items li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.checkout-total { display: flex; justify-content: space-between; font-size: 18px; margin-top: 14px; font-weight: 800; }

/* ---------- CONTACT ---------- */
.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; }
.contact-form-wrapper, .contact-info { background: #fff; padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); }
.map-wrapper { margin-top: 16px; border-radius: var(--radius-sm); overflow: hidden; }
.map-wrapper iframe { width: 100%; height: 250px; border: 0; }

/* ---------- ALERTS ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- EMPTY STATE ---------- */
.empty-state { text-align: center; padding: 60px 0; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--secondary); color: var(--gray-200); padding: 50px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-logo { color: #fff; font-size: 20px; margin-bottom: 10px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--accent); }
.social-icons { display: flex; gap: 10px; margin-top: 14px; font-size: 20px; }
.footer-bottom { text-align: center; padding: 18px 0; border-top: 1px solid #1e293b; font-size: 13px; }

/* =========================================================
   ADMIN STYLES
   ========================================================= */
.admin-body { background: var(--gray-100); }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--secondary); color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-logo { font-size: 18px; font-weight: 800; padding: 0 20px 20px; }
.admin-sidebar nav a { display: block; padding: 12px 20px; color: var(--gray-200); font-weight: 600; font-size: 14px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.08); color: #fff; border-right: 3px solid var(--accent); }
.logout-link { margin-top: 20px; color: #f87171 !important; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; padding: 16px 26px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.admin-topbar h1 { font-size: 20px; flex: 1; }
.admin-user { font-size: 14px; font-weight: 600; }
.admin-content { padding: 26px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; gap: 14px; align-items: center; }
.stat-card .stat-icon { font-size: 30px; }
.stat-card strong { font-size: 24px; display: block; }
.stat-card p { color: var(--gray-600); font-size: 13px; margin: 0; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.admin-card h3 { margin-top: 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.admin-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
.actions-cell { display: flex; gap: 6px; }
.btn-icon { display: inline-flex; padding: 6px 8px; border-radius: 6px; background: var(--gray-100); }
.btn-icon:hover { background: var(--gray-200); }
.btn-danger:hover { background: #fee2e2; }

.badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-block; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0e7ff; color: #3730a3; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-select { border: none; font-weight: 700; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.row-unread { background: #eff6ff; }

.admin-toolbar { display: flex; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.admin-search-form { display: flex; gap: 8px; }
.admin-search-form input, .admin-search-form select { padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.image-upload-block { background: var(--gray-100); padding: 12px; border-radius: var(--radius-sm); text-align: center; }
.image-preview { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--secondary), var(--primary)); }
.login-box { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-hover); width: 100%; max-width: 380px; }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 10px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .catalogue-layout { grid-template-columns: 200px 1fr; }
    .product-detail, .checkout-layout, .contact-layout { grid-template-columns: 1fr; }
    .admin-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .burger { display: block; }
    .main-nav { display: none; width: 100%; order: 3; }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { display: block; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
    .dropdown-menu { position: static; box-shadow: none; display: block; }
    .header-search { order: 4; max-width: 100%; width: 100%; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-text h1 { font-size: 30px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .catalogue-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid-2, .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { position: fixed; left: -230px; top: 0; height: 100%; z-index: 200; transition: var(--transition); }
    .admin-sidebar.active { left: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .hero-text h1 { font-size: 24px; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-grid-4 { grid-template-columns: 1fr 1fr; }
}
