/**
 * Styles responsive pour AFRICA-US
 */

/* Mobile First Approach */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        font-size: 0.875rem;
    }
    
    .product-card .card-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .search-form {
        margin: 10px 0;
    }
    
    .cart-item {
        padding: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .checkout-steps {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkout-step {
        flex-direction: row;
        justify-content: center;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .features-section .col-md-4 {
        margin-bottom: 2rem;
    }
    
    .cart-summary {
        margin-top: 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .hero-content {
        padding: 60px 0;
    }
    
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-content {
        margin-left: 200px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    
    .hero-content {
        padding: 80px 0;
    }
    
    .container {
        max-width: 960px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
    
    .hero-content {
        padding: 100px 0;
    }
    
    .container {
        max-width: 1140px;
    }
    
    .admin-content {
        padding: 30px;
    }
}

/* Specific responsive adjustments */

/* Navigation responsive */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(35, 47, 62, 0.95);
        backdrop-filter: blur(10px);
        margin-top: 10px;
        border-radius: 8px;
        padding: 15px;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Search responsive */
@media (max-width: 767.98px) {
    .search-form {
        width: 100%;
    }
    
    .search-form .input-group {
        width: 100%;
    }
    
    .search-suggestions {
        left: 0;
        right: 0;
        margin: 0 15px;
    }
}

/* Product detail responsive */
@media (max-width: 767.98px) {
    .product-gallery {
        margin-bottom: 2rem;
    }
    
    .product-thumbnails {
        justify-content: center;
        gap: 5px;
    }
    
    .product-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .quantity-selector {
        justify-content: center;
        margin: 15px 0;
    }
    
    .add-to-cart-section .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Cart responsive */
@media (max-width: 767.98px) {
    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cart-item-details {
        order: 1;
    }
    
    .cart-item-quantity {
        order: 2;
    }
    
    .cart-item-price {
        order: 3;
    }
    
    .cart-item-actions {
        order: 4;
    }
}

/* Checkout responsive */
@media (max-width: 767.98px) {
    .checkout-form {
        margin-bottom: 2rem;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .payment-method {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .order-summary {
        position: static;
        margin-top: 2rem;
    }
}

/* Admin responsive */
@media (max-width: 991.98px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
        width: 100%;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

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

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .admin-sidebar {
        display: none !important;
    }
    
    .admin-content {
        margin-left: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .text-orange {
        color: #000 !important;
    }
    
    .bg-orange {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-orange {
        background-color: #ff6600;
        border-color: #ff6600;
    }
    
    .text-muted {
        color: #666 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    .bg-light {
        background-color: #2d3748 !important;
    }
    
    .border {
        border-color: #4a5568 !important;
    }
}

/* 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 {
    box-shadow: 0 0 0 0.2rem rgba(255, 149, 0, 0.25);
    border-color: #ff9500;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff9500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}