/* ==========================================================================
   PARA BÉBÉ — Feuille de style principale
   Design system moderne et professionnel (teal / blanc clinique)
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

/* ---- Design tokens (canonical — mirrored in includes/colors.php) ---- */
:root {
    --primary-green: #0d9488;
    --dark-green: #0f766e;
    --light-green: #99f6e4;
    --accent-green: #2dd4bf;
    --soft-green: #5eead4;
    --subtle-blue: #38bdf8;
    --light-beige: #f1f5f9;

    --text-dark: #0f172a;
    --dark-gray: #1e293b;
    --text-light: #64748b;
    --medium-gray: #64748b;

    --bg-light: #ffffff;
    --white: #ffffff;
    --surface: #f8fafc;
    --border-color: #e2e8f0;

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.16);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   Header / Navigation (fallback — includes/header.php carries its own
   inline copy that takes precedence; kept in sync here for pages that
   only link this stylesheet)
   ========================================================================== */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }

.logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-text h1 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo-text span {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 400;
}

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-links { display: flex; gap: 0.5rem; align-items: center; }

.nav-link {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.16);
}

.search-container { position: relative; flex: 0 1 280px; min-width: 140px; }

.search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.7rem;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    font-size: 0.92rem;
    color: var(--text-dark);
    transition: box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}

.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--primary-green); }

.cart-icon {
    position: relative;
    color: white;
    text-decoration: none;
    padding: 0.55rem 1rem;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}
.cart-icon:hover { background: rgba(255,255,255,0.22); }

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.admin-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s ease;
}
.admin-link:hover { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--light-green) 0%, var(--subtle-blue) 50%, var(--light-beige) 100%);
    padding: 4rem 0;
    text-align: center;
    color: var(--text-dark);
}

.hero h2 { font-size: 2.75rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px; }
.hero p { font-size: 1.15rem; margin-bottom: 2rem; color: var(--text-light); }

.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: var(--text-dark);
    animation: zoomIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: 300ms;
}

@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.94) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.cta-button {
    display: inline-block;
    background: var(--primary-green);
    color: var(--white);
    padding: 0.9rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: var(--shadow-md);
}
.cta-button:hover { background: var(--dark-green); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ==========================================================================
   Main content / Sections
   ========================================================================== */
.main-content { max-width: 1280px; margin: 0 auto; padding: 3rem 2rem; }

.section-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2.25rem;
    letter-spacing: -0.5px;
}

/* ==========================================================================
   Categories
   ========================================================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

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

.category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-green);
}

.category-icon,
.category-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-green), var(--soft-green));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-icon img,
.category-thumb img { width: 70%; height: 70%; object-fit: contain; }

.category-card h3,
.category-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.category-card p,
.category-count { font-size: 0.85rem; color: var(--text-light); margin-top: 0.15rem; }

.category-meta { display: flex; flex-direction: column; }

@media (max-width: 640px) {
    .categories-grid { grid-template-columns: 1fr 1fr; }
    .category-card { flex-direction: column; text-align: center; padding: 1.1rem 0.8rem; }
}

/* ==========================================================================
   Products grid & card
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-green);
}

.product-image {
    height: 220px;
    background: linear-gradient(135deg, var(--surface), var(--light-beige));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img { max-height: 82%; max-width: 82%; object-fit: contain; transition: transform 0.3s ease; }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-image .emoji { font-size: 3.5rem; }

.product-info { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }

.product-name { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }

.product-description {
    color: var(--text-light);
    font-size: 0.88rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price { font-size: 1.35rem; font-weight: 800; color: var(--primary-green); margin-top: 0.2rem; }
.product-price .old-price { font-size: 0.9rem; color: var(--text-light); text-decoration: line-through; font-weight: 500; margin-left: 0.4rem; }

.product-rating { display: flex; align-items: center; gap: 0.5rem; }
.stars { color: #f59e0b; }
.rating-text { color: var(--text-light); font-size: 0.85rem; }

.product-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.add-to-cart-btn,
.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.add-to-cart-btn {
    flex: 1;
    background: var(--primary-green);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.add-to-cart-btn:hover { background: var(--dark-green); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.add-to-cart-btn:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; box-shadow: none; }
.add-to-cart-btn i, .btn-view i { color: inherit; }

.btn-view {
    background: var(--white);
    color: var(--primary-green);
    border-color: var(--primary-green);
}
.btn-view:hover { background: var(--primary-green); color: var(--white); }

@media (max-width: 480px) {
    .product-actions { flex-wrap: wrap; }
    .product-actions .btn-view,
    .product-actions .add-to-cart-btn { flex: 1 1 auto; }
}

/* ==========================================================================
   Filters / forms (generic)
   ========================================================================== */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.25rem;
}

.filters select,
.filters input {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--white);
    color: var(--text-dark);
}
.filters select:focus,
.filters input:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

/* ==========================================================================
   Quantity selector (product page / cart)
   ========================================================================== */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quantity-btn {
    background: var(--surface);
    border: none;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-dark);
    transition: background 0.15s ease;
}
.quantity-btn:hover { background: var(--light-green); }
.quantity-input {
    width: 48px;
    height: 38px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-dark);
}
.quantity-input:focus { outline: none; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0 0.6rem;
}
.pagination a:hover { background: var(--light-green); }
.pagination .active,
.pagination a.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: var(--white);
}

/* ==========================================================================
   Promo banner
   ========================================================================== */
.promo-banner {
    background: linear-gradient(135deg, var(--primary-green), var(--subtle-blue));
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0;
    border-radius: var(--radius-lg);
}
.promo-banner h3 { font-size: 1.9rem; font-weight: 800; margin-bottom: 0.75rem; }
.promo-banner p { font-size: 1.05rem; opacity: 0.92; margin-bottom: 1.5rem; }

/* ==========================================================================
   Product details (generic fallback grid)
   ========================================================================== */
.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
@media (max-width: 860px) {
    .product-details { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer (base fallback — includes/footer.php carries its own inline copy)
   ========================================================================== */
.footer { background: linear-gradient(135deg, #1f2937, #374151); color: var(--white); padding: 3rem 0 1.5rem; }
.footer .container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-section h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; color: var(--soft-green); }
.footer-section p, .footer-section a { color: #cbd5e1; text-decoration: none; margin-bottom: 0.5rem; display: block; transition: color 0.2s ease; }
.footer-section a:hover { color: var(--soft-green); }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-link { color: var(--white); font-size: 1.3rem; transition: color 0.2s ease; }
.social-link:hover { color: var(--soft-green); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.25rem; text-align: center; color: #9ca3af; }

/* ==========================================================================
   Notifications
   ========================================================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}
.notification.success { background: linear-gradient(135deg, #34d399, var(--success)); border-left: 4px solid #15803d; }
.notification.error { background: linear-gradient(135deg, #f87171, var(--danger)); border-left: 4px solid #b91c1c; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Admin stat cards (shared component, used by admin dashboard)
   ========================================================================== */
.stats-grid { display: flex; gap: 1rem; align-items: stretch; margin: 1.25rem 0; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 180px; background: var(--white); padding: 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.stat-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stat-title { font-size: 0.92rem; color: var(--text-light); }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); margin-top: 0.25rem; }
.stat-change { font-size: 0.82rem; color: var(--text-light); margin-top: 0.35rem; }
.stat-icon { font-size: 1.6rem; color: var(--primary-green); background: var(--light-beige); padding: 0.55rem; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.tables-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.table-card { background: var(--white); padding: 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
@media (max-width: 900px) { .stats-grid { flex-direction: column; } }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-section { padding: 4rem 0; background: linear-gradient(135deg, var(--surface), var(--light-beige)); }
.contact-section .container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; text-align: center; }
.contact-section h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.contact-section .lead { color: var(--text-light); max-width: 700px; margin: 0 auto 1.5rem; }
.contact-form { margin-top: 1.25rem; text-align: left; background: var(--white); padding: 1.75rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md); border: 1px solid var(--border-color); }
.contact-form .form-row { margin-bottom: 1rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 0.45rem; color: var(--text-dark); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-family: inherit;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .btn {
    display: inline-block;
    background: var(--primary-green);
    color: #fff;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}
.contact-form .btn:hover { background: var(--dark-green); transform: translateY(-2px); }
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.alert.success { background: #ecfdf5; border: 1px solid #bbf7d0; color: #064e3b; }
.alert.error { background: #fff1f2; border: 1px solid #fecaca; color: #7f1d1d; }

/* ==========================================================================
   Entrance animations
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.6s ease-out; }

.product-card, .stat-card, .category-card {
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.product-card.in-view, .stat-card.in-view, .category-card.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.nav-link:focus,
.cta-button:focus,
.add-to-cart-btn:focus,
.btn-view:focus {
    outline: 2px solid var(--subtle-blue);
    outline-offset: 2px;
}

.loading { opacity: 0.6; pointer-events: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

@media (max-width: 768px) {
    /* En-tête sur une seule ligne (logo + hamburger) : le sélecteur de
       langue/mode sombre/lien admin sont déjà dans le tiroir mobile
       (.mobile-menu, voir includes/header.php) — les réafficher ici aussi
       repassait l'en-tête sur deux lignes. */
    .nav-utility, .admin-link { display: none; }
    .hero h2, .hero-title { font-size: 2rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .container, .main-content { padding-left: 1rem; padding-right: 1rem; }
    .products-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
    .hero { padding: 2.5rem 0; }
}
