/* ============================================
   PROXISTORE - Premium Mobile Responsive CSS
   Thème Sénégalais - Version Mobile Optimisée
   ============================================ */

:root {
    --gold-senegal: #D4A84B;
    --terracotta: #C75B39;
    --warm-sand: #F4E4C1;
    --baobab-green: #2D5016;
    --ocean-blue: #1E3A5F;
}

/* ============================================
   NAVBAR MOBILE AMÉLIORÉE
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
    }

    .navbar .logo h1 {
        font-size: 1.3rem;
    }

    .navbar .logo span {
        font-size: 0.75rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(180deg, var(--ocean-blue) 0%, #2D5A7B 100%);
        flex-direction: column;
        padding: 80px 25px 30px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        color: #fff;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
        z-index: 1001;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   HERO SECTIONS MOBILE
   ============================================ */
@media (max-width: 768px) {

    .shop-hero,
    .wishlist-hero,
    .orders-hero,
    .profile-hero,
    .order-hero {
        padding: 25px 20px;
        border-radius: 16px;
        margin-bottom: 25px;
    }

    .shop-hero h1,
    .wishlist-hero h1,
    .orders-hero h1,
    .profile-hero h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .shop-hero p,
    .wishlist-hero p,
    .orders-hero p {
        font-size: 0.9rem;
    }

    /* Stats dans hero */
    .hero-stats,
    .wishlist-stats,
    .orders-stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-card,
    .stat-item {
        padding: 12px 15px;
        width: 100%;
        text-align: center;
    }

    .stat-card .value,
    .stat-item .value {
        font-size: 1.4rem;
    }
}

/* ============================================
   GRILLES PRODUITS MOBILE
   ============================================ */
@media (max-width: 992px) {

    .products-grid,
    .wishlist-grid,
    .similar-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

@media (max-width: 576px) {

    .products-grid,
    .wishlist-grid,
    .similar-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .product-card {
        border-radius: 14px;
    }

    .product-card .product-image {
        height: 180px;
    }

    .product-card .product-info {
        padding: 12px;
    }

    .product-card .product-name {
        font-size: 0.95rem;
    }

    .product-card .product-price {
        font-size: 1rem;
    }

    .product-card .btn-add-cart {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* ============================================
   PAGE PRODUIT MOBILE
   ============================================ */
@media (max-width: 768px) {
    .product-page {
        padding: 80px 15px 40px;
    }

    .breadcrumb {
        font-size: 0.8rem;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .product-main {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .main-image img,
    .main-image .no-img {
        height: 300px;
    }

    .image-thumbnails {
        justify-content: center;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-title {
        font-size: 1.4rem;
    }

    .product-price-box {
        padding: 18px;
    }

    .price-current {
        font-size: 1.8rem;
    }

    .price-original {
        font-size: 1rem;
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }

    .product-meta-grid {
        grid-template-columns: 1fr;
    }

    .quantity-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-add-cart,
    .btn-buy-now {
        width: 100%;
        padding: 14px;
    }

    .shop-card {
        padding: 18px;
    }

    .shop-buttons {
        flex-direction: column;
    }

    .shop-btn {
        width: 100%;
    }
}

/* ============================================
   PANIER MOBILE
   ============================================ */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr !important;
    }

    .cart-summary {
        position: static !important;
        order: -1;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: 80px 15px 40px;
    }

    .cart-header {
        padding: 20px;
        border-radius: 16px;
    }

    .cart-header h1 {
        font-size: 1.4rem;
    }

    .shop-section {
        border-radius: 14px;
        margin-bottom: 15px;
    }

    .shop-header {
        padding: 15px;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .cart-item .item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item .item-details {
        width: 100%;
    }

    .cart-item .item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .quantity-controls {
        transform: scale(0.9);
    }

    .cart-summary {
        padding: 20px;
        border-radius: 16px;
    }
}

/* ============================================
   CHECKOUT MOBILE
   ============================================ */
@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr !important;
    }

    .order-summary {
        position: static !important;
        order: -1;
    }
}

@media (max-width: 768px) {
    .checkout-container {
        padding: 80px 15px 40px;
    }

    .checkout-header h1 {
        font-size: 1.5rem;
    }

    .checkout-steps {
        gap: 15px;
    }

    .step-label {
        display: none;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .form-section {
        padding: 20px;
    }

    .section-title {
        font-size: 1rem;
    }

    .section-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .payment-option {
        padding: 15px;
    }

    .payment-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .payment-info h4 {
        font-size: 0.95rem;
    }

    .payment-info p {
        font-size: 0.8rem;
    }

    .btn-submit {
        margin: 15px;
        width: calc(100% - 30px);
        padding: 15px;
        font-size: 1rem;
    }

    .order-summary {
        padding: 18px;
    }

    .summary-title {
        font-size: 1.05rem;
    }
}

/* ============================================
   COMMANDES MOBILE
   ============================================ */
@media (max-width: 768px) {
    .orders-container {
        padding: 80px 15px 40px;
    }

    .order-card {
        border-radius: 14px;
        margin-bottom: 15px;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }

    .order-info h3 {
        font-size: 1rem;
    }

    .order-meta {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 5px;
    }

    .order-status {
        text-align: left;
        width: 100%;
    }

    .status-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .order-content {
        padding: 15px;
    }

    .order-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .summary-item {
        padding: 12px 10px;
    }

    .summary-value {
        font-size: 0.95rem;
    }

    .delivery-info,
    .notes-info,
    .contact-info {
        padding: 12px;
        font-size: 0.9rem;
    }

    .order-actions {
        flex-direction: column;
    }

    .btn-details,
    .btn-cancel,
    .btn-review {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

/* ============================================
   DÉTAILS COMMANDE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .order-details-container {
        padding: 80px 15px 40px;
    }

    .order-hero {
        padding: 20px;
        border-radius: 16px;
    }

    .order-title-row {
        flex-direction: column;
        gap: 15px;
    }

    .order-hero h1 {
        font-size: 1.3rem;
    }

    .order-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 0.85rem;
    }

    .delivery-code-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .delivery-code {
        font-size: 1.8rem;
        padding: 12px 20px;
        letter-spacing: 3px;
    }

    .order-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .order-section {
        padding: 18px;
        border-radius: 14px;
    }

    .section-title {
        font-size: 1rem;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .item-image {
        width: 60px;
        height: 60px;
    }

    .order-actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   PROFIL MOBILE
   ============================================ */
@media (max-width: 768px) {
    .profile-container {
        padding: 80px 15px 40px;
    }

    .profile-hero {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .profile-avatar {
        width: 85px;
        height: 85px;
        font-size: 2rem;
    }

    .profile-hero h1 {
        font-size: 1.4rem;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        order: -1;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .action-card {
        padding: 15px;
    }

    .action-icon {
        font-size: 1.5rem;
    }

    .action-card h4 {
        font-size: 0.8rem;
    }

    .section-tabs {
        overflow-x: auto;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .tab-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   WISHLIST MOBILE
   ============================================ */
@media (max-width: 768px) {
    .wishlist-container {
        padding: 80px 15px 40px;
    }

    .wishlist-hero {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .wishlist-hero h1 {
        font-size: 1.5rem;
    }

    .wishlist-stats {
        flex-direction: column;
        gap: 10px;
    }

    .wishlist-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .wishlist-card {
        border-radius: 14px;
    }

    .wishlist-card .product-image {
        height: 180px;
    }

    .wishlist-actions {
        flex-direction: column;
        gap: 8px;
    }

    .wishlist-actions button,
    .wishlist-actions a {
        width: 100%;
    }

    .floating-cart-btn {
        bottom: 20px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}

/* ============================================
   FILTRES MOBILE (Shop)
   ============================================ */
@media (max-width: 768px) {
    .filters-section {
        padding: 15px;
        border-radius: 14px;
    }

    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .filter-group select,
    .filter-group input {
        padding: 12px;
        font-size: 0.9rem;
    }

    .btn-filter {
        width: 100%;
        padding: 12px;
    }
}

/* ============================================
   BOUTONS ET FORMULAIRES GLOBAUX MOBILE
   ============================================ */
@media (max-width: 768px) {
    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    textarea.form-control {
        min-height: 100px;
    }

    .btn,
    .btn-submit,
    .btn-primary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* ============================================
   SCROLL HORIZONTAL POUR TABLEAUX
   ============================================ */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 600px;
    }
}

/* ============================================
   ANIMATIONS MOBILE OPTIMISÉES
   ============================================ */
@media (max-width: 768px) {

    /* Désactiver les animations complexes sur mobile pour performance */
    .hero-stats::before,
    .shop-hero::before,
    .wishlist-hero::before,
    .orders-hero::before {
        display: none;
    }

    /* Réduire les ombres pour meilleures performances */
    .product-card,
    .order-card,
    .stats-card,
    .section-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }
}

/* ============================================
   BOUTON FLOTTANT PANIER MOBILE
   ============================================ */
@media (max-width: 768px) {
    .cart-float-btn {
        position: fixed;
        bottom: 20px;
        right: 15px;
        width: 55px;
        height: 55px;
        background: linear-gradient(135deg, var(--terracotta) 0%, var(--gold-senegal) 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 1.5rem;
        box-shadow: 0 4px 20px rgba(199, 91, 57, 0.4);
        z-index: 100;
        text-decoration: none;
    }

    .cart-float-btn .badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: var(--baobab-green);
        color: #fff;
        font-size: 0.75rem;
        min-width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   ÉTATS VIDES MOBILE
   ============================================ */
@media (max-width: 768px) {

    .empty-state,
    .empty-orders,
    .empty-wishlist,
    .empty-cart {
        padding: 50px 20px;
        border-radius: 16px;
    }

    .empty-icon {
        font-size: 3.5rem;
        margin-bottom: 15px;
    }

    .empty-state h3,
    .empty-orders h3 {
        font-size: 1.2rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }

    .btn-shop {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

/* ============================================
   ESPACEMENT GÉNÉRAL MOBILE
   ============================================ */
@media (max-width: 768px) {

    .container,
    .cart-container,
    .checkout-container,
    .orders-container,
    .profile-container,
    .product-page,
    .wishlist-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    section {
        margin-bottom: 25px;
    }
}

/* ============================================
   SAFE AREA POUR IPHONE X+
   ============================================ */
@supports (padding: max(0px)) {

    .checkout-form .btn-submit,
    .cart-float-btn,
    .floating-cart-btn {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}