/* ==========================================================================
   LOTUS TOOLS - Responsive & Impression (Print) Styles
   ========================================================================== */

/* Tablettes & Petits Écrans (<= 1024px) */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.3rem;
  }

  .footer-links-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Mobiles & Tablettes Portrait (<= 768px) */
@media (max-width: 768px) {
  .top-nav-inner {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
  }
  
  .top-nav-menu {
    gap: 0.4rem;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }

  .top-nav-link {
    font-size: 0.8rem;
    padding: 0.25rem 0.45rem;
  }

  .top-nav-extra {
    display: none;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .brand-logo {
    font-size: 1.25rem;
  }

  .brand-icon-box {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .nav-action-btn span {
    display: none;
  }

  .hero-slide-overlay {
    background: linear-gradient(0deg, 
      rgba(23, 35, 58, 0.96) 0%, 
      rgba(23, 35, 58, 0.8) 65%, 
      rgba(23, 35, 58, 0.3) 100%);
    align-items: flex-end;
  }

  .hero-slide-container {
    padding: 1.5rem 1rem 2.5rem;
  }

  .hero-slide-tag {
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.5rem;
  }

  .hero-slide-title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  .hero-slide-desc {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-slide-actions .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .slider-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .slider-prev {
    left: 8px;
  }

  .slider-next {
    right: 8px;
  }

  .hero-stats.fullwidth {
    gap: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  /* Barre de Recherche Autocomplémentaire Mobile */
  .catalog-search-autocomplete-section {
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }

  .catalog-search-input {
    height: 48px;
    font-size: 0.92rem;
    padding: 0.65rem 2.75rem 0.65rem 2.75rem;
  }

  .search-prefix-icon {
    left: 1rem;
    font-size: 1.1rem;
  }

  .search-clear-btn {
    right: 0.85rem;
    font-size: 1.15rem;
  }

  .autocomplete-item {
    padding: 0.65rem 0.75rem;
    gap: 0.65rem;
  }

  .autocomplete-item-img {
    width: 38px;
    height: 38px;
  }

  .autocomplete-item-name {
    font-size: 0.85rem;
  }

  .autocomplete-item-price {
    font-size: 0.85rem;
  }

  .search-quick-tags {
    gap: 0.35rem;
  }

  .quick-tag-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  /* Menu Déroulant Filtres Mobile */
  .search-and-filter-row {
    gap: 0.5rem;
  }

  .btn-filter-dropdown {
    height: 48px;
    padding: 0 0.85rem;
    font-size: 0.85rem;
  }

  .filter-multiselect-menu {
    width: 100%;
    max-height: 420px;
  }

  /* Modale Fiche Produit */
  .product-modal-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .product-modal-image {
    max-height: 250px;
  }

  /* Tunnel de commande */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .client-type-switcher {
    flex-direction: column;
    gap: 0.5rem;
  }

  .checkout-body {
    padding: 1.25rem;
  }

  /* Bon de commande / Facture */
  .invoice-box {
    padding: 1.25rem;
  }

  .invoice-header {
    flex-direction: column;
    gap: 1.25rem;
  }

  .invoice-meta {
    text-align: left;
  }

  .invoice-parties {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .invoice-totals-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .invoice-table th:nth-child(1),
  .invoice-table td:nth-child(1) {
    display: none; /* Cacher SKU sur mobile très étroit */
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .toast {
    min-width: calc(100vw - 2rem);
  }
}

/* ==========================================================================
   Petits Smartphones (<= 576px)
   ========================================================================== */
@media (max-width: 576px) {
  /* En-tête & Barre supérieure */
  .top-navbar {
    padding: 0.25rem 0.5rem;
  }
  .top-nav-inner {
    padding: 0.2rem 0;
  }
  .top-nav-menu {
    gap: 0.25rem;
  }
  .top-nav-link {
    font-size: 0.74rem;
    padding: 0.2rem 0.35rem;
  }

  .header-inner {
    padding: 0.5rem 0;
    gap: 0.65rem;
  }
  .brand-logo {
    font-size: 1.1rem;
  }
  .brand-icon-box {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .header-actions {
    gap: 0.4rem;
  }
  .nav-action-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  .badge-counter {
    top: -5px;
    right: -5px;
    font-size: 0.68rem;
    min-width: 18px;
    height: 18px;
  }

  /* Slider Hero */
  .hero-slide-container {
    padding: 1rem 0.75rem 2rem;
  }
  .hero-slide-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }
  .hero-slide-title {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
  }
  .hero-slide-desc {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    -webkit-line-clamp: 2;
  }
  .hero-slide-actions .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }
  .slider-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  /* Barre de recherche et filtres du catalogue */
  .catalog-search-autocomplete-section {
    padding: 0.75rem 0.6rem;
    border-radius: 12px;
  }
  .search-and-filter-row {
    gap: 0.4rem;
  }
  .catalog-search-input {
    height: 44px;
    font-size: 0.86rem;
    padding-left: 2.4rem;
    padding-right: 2.2rem;
  }
  .search-prefix-icon {
    left: 0.8rem;
    font-size: 1rem;
  }
  .search-clear-btn {
    right: 0.65rem;
  }
  .btn-filter-dropdown {
    height: 44px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
  }
  .filter-multiselect-menu {
    width: 100%;
    max-width: none;
  }
  .quick-tag-btn {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  /* Cartes produits */
  .product-card {
    border-radius: 12px;
  }
  .product-image-container {
    height: 190px;
  }
  .product-content {
    padding: 1rem;
  }
  .product-title {
    font-size: 0.95rem;
  }
  .product-price-ht {
    font-size: 1.25rem;
  }
  .product-card-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .product-card-actions .qty-selector {
    width: 100%;
    justify-content: center;
  }
  .product-card-actions .btn-add-cart {
    width: 100%;
    justify-content: center;
    height: 42px;
  }

  /* Panier Latéral (Drawer) Plein écran mobile */
  .cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .cart-drawer-header {
    padding: 1rem;
  }
  .cart-drawer-body {
    padding: 0.85rem;
  }
  .cart-drawer-footer {
    padding: 1rem;
  }
  .cart-item {
    padding: 0.75rem;
    gap: 0.6rem;
  }
  .cart-item-img {
    width: 52px;
    height: 52px;
  }

  /* Modale Fiche Produit */
  .modal-wrapper {
    padding: 0.5rem;
  }
  .modal-dialog,
  .custom-modal-dialog {
    max-height: 94vh;
    border-radius: 12px;
    margin: 0;
  }
  .product-modal-grid {
    padding: 1rem;
    gap: 1rem;
  }
  .product-modal-image img {
    max-height: 200px;
  }
  .modal-product-title {
    font-size: 1.15rem;
  }
  .modal-price-ht {
    font-size: 1.35rem;
  }
  .modal-add-box {
    flex-direction: column;
    gap: 0.6rem;
  }
  .modal-add-box .qty-selector {
    width: 100%;
    justify-content: center;
  }
  .modal-add-box .btn {
    width: 100%;
    height: 44px;
    justify-content: center;
  }

  /* Modale Tunnel de Commande */
  .checkout-header {
    padding: 1rem 1.15rem;
  }
  .checkout-header h3 {
    font-size: 1.1rem;
  }
  .checkout-body {
    padding: 1rem;
  }
  .checkout-footer {
    padding: 0.85rem 1rem;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .checkout-footer .btn {
    width: 100%;
    justify-content: center;
    height: 44px;
  }
  .client-type-switcher {
    width: 100%;
  }
  .client-type-btn {
    padding: 0.55rem;
    font-size: 0.82rem;
    justify-content: center;
  }

  /* Modale Bon de Commande / Facture */
  .invoice-box {
    padding: 0.85rem;
  }
  .invoice-logo {
    height: 40px;
  }
  .invoice-title {
    font-size: 1.25rem;
  }
  .invoice-actions-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .invoice-actions-bar .btn {
    width: 100%;
    justify-content: center;
  }
  .invoice-table {
    font-size: 0.78rem;
  }
  .invoice-table th,
  .invoice-table td {
    padding: 0.5rem 0.35rem;
  }

  /* Pied de page */
  .main-footer {
    padding: 2.5rem 0 1.5rem;
  }
  .footer-col h5 {
    font-size: 1rem;
  }
}

/* Écrans très étroits (<= 380px) */
@media (max-width: 380px) {
  .hero-slide-title {
    font-size: 1.1rem;
  }
  .brand-logo-text h1 {
    font-size: 1rem;
  }
  .catalog-search-input {
    font-size: 0.8rem;
  }
  .btn-filter-dropdown span {
    display: none;
  }
  .invoice-totals-table {
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Règles d'Impression (@media print)
   Génération propre de facture / bon de commande papier ou PDF
   ========================================================================== */
@media print {
  /* Masquer tous les éléments du site sauf la facture */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .main-header,
  .hero-section,
  .catalog-section,
  .main-footer,
  .cart-drawer,
  .drawer-overlay,
  .toast-container,
  .modal-backdrop,
  .modal-close-icon,
  .invoice-actions-bar,
  #product-detail-modal,
  #checkout-modal,
  #orders-modal {
    display: none !important;
  }

  #confirmation-modal {
    position: static !important;
    display: block !important;
    padding: 0 !important;
  }

  .modal-dialog.invoice-dialog {
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    animation: none !important;
  }

  .invoice-box {
    padding: 0 !important;
  }

  .invoice-header {
    border-bottom: 2px solid #000000 !important;
  }

  .invoice-table th {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
  }

  .invoice-table td {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #000000 !important;
  }

  .badge-status-pro {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border: 1px solid #94a3b8 !important;
  }

  .total-row.grand-total {
    border-top: 2px solid #000000 !important;
  }

  .total-row.grand-total strong {
    color: #000000 !important;
  }

  @page {
    margin: 1.5cm;
  }
}
