/**
 * COURS AVICENNE SHOP - Stylesheet
 * Thème Bleu Nuit & Or Institutionnel avec effets 3D tactiles et design responsive moderne
 */

:root {
    --primary: #1e3a8a;
    --primary-dark: #0f172a;
    --primary-light: #3b82f6;
    --accent: #d97706;
    --accent-hover: #b45309;
    --gold: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* TOP ANNOUNCEMENT BAR */
.top-bar {
    background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-content {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.top-bar-badges {
    display: flex;
    gap: 16px;
    align-items: center;
}

.top-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* NAVIGATION */
.shop-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.logo-text-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: color 0.2s ease;
    padding: 6px 0;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-btn-trigger {
    background: #ffffff;
    border: 1.5px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.cart-btn-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.1);
}

.cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-badge {
    background: var(--accent);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* HERO BANNER */
.shop-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 70%, #172554 100%);
    color: #ffffff;
    padding: 48px 20px 40px;
    position: relative;
    overflow: hidden;
}

.shop-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef08a;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-desc {
    font-size: 1.05rem;
    color: #cbd5e1;
    max-width: 720px;
    line-height: 1.6;
}

.hero-guarantees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.guarantee-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.guarantee-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guarantee-text strong {
    display: block;
    font-size: 0.85rem;
    color: #ffffff;
}

.guarantee-text span {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* MAIN SHOP CONTAINER */
.shop-layout {
    max-width: 1280px;
    margin: 32px auto 64px;
    padding: 0 20px;
}

/* FILTER AND SEARCH BAR */
.controls-bar {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.category-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-pill {
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.search-sort-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    width: 220px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    width: 260px;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
    pointer-events: none;
}

/* PRODUCT GRID */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* 3D PRODUCT CARD */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
    border-color: #cbd5e1;
}

.product-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #f1f5f9;
    overflow: hidden;
}

.product-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-thumb {
    transform: scale(1.05);
}

.badge-float {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.badge-featured {
    background: var(--accent);
}

.product-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.product-cat {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.product-title:hover {
    color: var(--primary);
}

.product-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.product-meta-delivery {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #047857;
    background: #ecfdf5;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
    font-weight: 600;
}

.product-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.product-pricing {
    display: flex;
    flex-direction: column;
}

.product-price-ttc {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.product-price-sub {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* 3D TACTILE BUTTONS */
.btn-3d {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid #1e3a8a;
    border-bottom: 3px solid #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.1s ease;
    user-select: none;
}

.btn-3d:hover {
    filter: brightness(1.08);
}

.btn-3d:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-3d-accent {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    border-bottom: 3px solid #b45309;
    color: #ffffff;
}

.btn-3d-accent:hover {
    filter: brightness(1.06);
}

.btn-3d-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-bottom: 3px solid #cbd5e1;
}

.btn-3d-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* SLIDE-OVER CART DRAWER */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100%;
    height: 100%;
    background: #ffffff;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-drawer-overlay.active .cart-drawer {
    transform: translateX(0);
}

.cart-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.cart-close-btn:hover {
    color: var(--text-main);
}

.free-shipping-progress {
    background: #f1f5f9;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.shipping-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
    transition: width 0.4s ease;
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.cart-item-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.cart-item-variant {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2px;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-page);
}

.qty-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e2e8f0;
}

.qty-val {
    width: 32px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.cart-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.cart-remove-btn:hover {
    color: var(--danger);
}

.cart-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cart-empty-icon {
    font-size: 3rem;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-summary-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    border-top: 1px solid var(--border-light);
    padding-top: 8px;
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.cart-security-badge {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* TOAST NOTIFICATION */
.toast-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--accent);
}

.toast-notice.show {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */
.shop-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 48px 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    margin-bottom: 36px;
}

.footer-col-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .top-bar-badges {
        display: none;
    }
    .search-box {
        width: 100%;
    }
    .search-input {
        width: 100% !important;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}
