/* Styles pour header mobile et optimisations téléphone */

/* Header mobile simplifié */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cacher le header mobile sur desktop */
@media (min-width: 1024px) {
    .mobile-header {
        display: none !important;
    }
}

/* Styles pour téléphone */
.phone-device .mobile-header {
    padding: 0.75rem 1rem;
}

.phone-device .mobile-header h1,
.phone-device .mobile-header .logo {
    font-size: 1.25rem;
}

/* Menu mobile simplifié */
#mobile-menu-simple {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#mobile-menu-simple a {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

#mobile-menu-simple a:last-child {
    border-bottom: none;
}

/* Barre de recherche mobile */
#mobile-search-bar {
    animation: slideDown 0.3s ease-out;
}

#mobile-search-bar.hidden {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Optimisations pour téléphone */
.phone-device {
    font-size: 14px;
}

.phone-device main,
.phone-device .main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Cartes produits optimisées mobile */
.phone-device .product-card.mobile-optimized {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.phone-device .product-card.mobile-optimized img {
    height: 200px;
    object-fit: cover;
}

.phone-device .product-card.mobile-optimized .p-4,
.phone-device .product-card.mobile-optimized .p-5 {
    padding: 1rem;
}

.phone-device .product-card.mobile-optimized h3 {
    font-size: 1rem;
    line-height: 1.4;
}

.phone-device .product-card.mobile-optimized .text-xl {
    font-size: 1.125rem;
}

/* Grille produits responsive pour téléphone */
.phone-device .grid {
    gap: 0.75rem;
}

.phone-device .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.phone-device .sm\:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.phone-device .md\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phone-device .lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Badge panier mobile */
.mobile-header .cart-badge {
    font-size: 10px;
    height: 16px;
    width: 16px;
    line-height: 1;
}

/* Boutons d'action mobile */
.phone-device button,
.phone-device .btn {
    min-height: 44px; /* Taille minimum pour les touches sur mobile */
    padding: 0.75rem 1rem;
}

/* Navigation sticky pour mobile */
.phone-device .mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Cacher éléments desktop sur téléphone */
.phone-device .hidden-on-phone {
    display: none !important;
}

/* Afficher éléments mobile uniquement sur téléphone */
.mobile-only {
    display: none;
}

.phone-device .mobile-only {
    display: block;
}

.phone-device .mobile-only.inline {
    display: inline;
}

.phone-device .mobile-only.flex {
    display: flex;
}

/* Espacement réduit pour téléphone */
.phone-device .space-y-8 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1.5rem;
}

.phone-device .space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}

.phone-device .py-12 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.phone-device .py-8 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* Footer mobile */
.phone-device footer {
    padding: 1.5rem 1rem;
}

.phone-device footer .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

/* Amélioration des formulaires sur mobile */
.phone-device input[type="text"],
.phone-device input[type="email"],
.phone-device input[type="password"],
.phone-device textarea,
.phone-device select {
    font-size: 16px; /* Évite le zoom sur iOS */
    padding: 0.75rem;
}

/* Optimisation des modales sur mobile */
.phone-device .modal,
.phone-device .dialog {
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Animation d'ouverture/fermeture du menu mobile */
#mobile-menu-simple {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
}

#mobile-menu-simple.hidden {
    transform: scaleY(0);
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* Force le mode mobile quand nécessaire */
.force-mobile .mobile-header {
    display: block !important;
}

.force-mobile nav:not(.mobile-header) {
    display: none !important;
}