/**
 * Styles CSS personnalisés pour l'e-commerce
 */

 /* avec panier flottant */

:root {
    --primary-color: #2563eb;
    --secondary-color: #059669;
    --accent-color: #dc2626;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Bootstrap overrides */
.btn-xs {
    padding: 0.15rem 0.35rem; /* réduit la hauteur et la largeur */
    font-size: 0.75rem;       /* réduit la taille de l’icône ou du texte */
    line-height: 1;           /* compact */
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Layout */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Header */
.header-main {
    border-bottom: 1px solid var(--border-color);
}

.language-selector .dropdown-toggle {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Navigation */
.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
   z-index: 1090;
}

/* Cart dropdown */
.cart-dropdown-menu {
    min-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
}

/* Floating cart */
.cart-dropdown.floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background-color: #fff;
    border-radius: 50%;
    padding: 8px;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.cart-dropdown.floating #cart-btn {
    margin: 0;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.cart-dropdown.floating .cart-count {
    top: -5px;
    right: -5px;
}

/* Cards */
.card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Product cards */
.product-card {
    height: 100%;
}

.product-card .card-img-top {
    transition: transform 0.3s ease;
}

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

.product-card .badge {
    font-size: 0.75rem;
}

/* Category cards */
.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color) !important;
}

.category-icon, .category-image {
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon,
.category-card:hover .category-image {
    transform: scale(1.1);
}

/* Buttons */
.btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.add-to-cart {
    position: relative;
    overflow: hidden;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.add-to-cart:hover::before {
    left: 100%;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Filters sidebar */
.filters-sidebar {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.filter-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
}

.hero-section .btn-light:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

/* Features section */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Newsletter */
.newsletter-form .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.footer a {
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ffffff !important;
}

/* Loading animations */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.badge.bg-orange {
    background-color: #f97316 !important;
}

/* Cart count badge */
.cart-count {
    font-size: 0.7rem;
    min-width: 1.2rem;
    height: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

/* Cart transition effects */
.cart-dropdown {
    transition: all 0.3s ease;
}

/* Floating cart container */
.floating-cart-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(-20px);
}

.floating-cart-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-cart-container #floating-cart-btn {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.floating-cart-container #floating-cart-count {
    font-size: 0.7rem;
    min-width: 1.2rem;
    height: 1.2rem;
    line-height: 1;
    top: 0px;
    right: -1.5rem;
}



@media (max-width: 768px) {
    .floating-cart-container {
        top: 10px;
        right: 10px;
    }
    
    .floating-cart-container #floating-cart-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}
/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .filters-sidebar {
        margin-bottom: 2rem;
    }
    
    .cart-dropdown-menu {
        min-width: 300px;
        max-width: 90vw;
    }
    
    .product-card .card-img-top {
        height: 200px;
    }
    
    /* Mobile floating cart adjustments */
    .cart-dropdown.floating {
        top: 10px;
        right: 10px;
        z-index: 1080; /* S'assurer qu'il est au-dessus des autres éléments */

    }
    
    .cart-dropdown.floating #cart-btn {
        height: 45px;
        width: 45px;
        font-size: 1.1rem;
    }
    .cart-dropdown.floating .dropdown-menu {
        position: fixed !important;
        top: 65px !important; /* Ajusté pour être juste en dessous du bouton */
        right: 10px !important;
        left: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: 350px !important;
        max-height: 80vh !important; /* Limiter la hauteur sur petit écran */
    }

}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section .display-4 {
        font-size: 1.5rem;
    }
    
    .feature-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .category-icon, .category-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .product-card .card-img-top {
        height: 180px;
    }
}

/* Print styles */
@media print {
    .header-main,
    .footer,
    .filters-sidebar,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1f2937;
        --text-color: #f8fafc;
        --border-color: #374151;
    }
}

/* Shared cart styles */
.shared-cart-mode {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.shared-cart-item {
    transition: background-color 0.3s ease;
}

.shared-cart-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.shared-cart-notification {
    z-index: 9999;
}

.shared-cart-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation utilities */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-30px,0);
    }
    70% {
        transform: translate3d(0,-15px,0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* Wishlist styles */
.wishlist-toggle {
    transition: all 0.3s ease;
}

.wishlist-toggle:hover {
    transform: scale(1.1);
}

.wishlist-toggle.in-wishlist i {
    color: #dc3545 !important;
}

.wishlist-toggle.in-wishlist i:hover {
    color: hsl(345, 18%, 96%) !important;
}

.wishlist-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wishlist-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

.wishlist-item .remove-from-wishlist {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.wishlist-item:hover .remove-from-wishlist {
    opacity: 1;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.wishlist-count-badge {
    font-size: 0.7rem;
    min-width: 1.2rem;
    height: 1.2rem;
    line-height: 1;
}