input[type="number"],
input[type="date"] {
    height: 36px;
    border: 2px solid #E5E7EB;
    padding: 0.5rem 1rem;
    width: 25%;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #F9FAFB;
}
input[type="text"] {
    height: 42px;
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #F9FAFB;
}
input[type="number"]:hover,
input[type="text"]:hover,
input[type="date"]:hover {
    border-color: #D1D5DB;
    background-color: #FFFFFF;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="date"]:focus {
    border-color: #EF4444;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    outline: none;
}

/* Quantity input styling */
input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* Button styling */
button {
    position: relative;
    transition: all 0.2s ease;
}

button:focus {
    outline: none;
}

button:active {
    transform: translateY(1px);
}

/* Loading button state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid white;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* Order summary table styling */
#orderSummaryBody tr {
    transition: all 0.3s ease;
}

#orderSummaryBody tr:hover {
    background-color: #FEF2F2;
}

/* Product form panel styling */
#manualOrderForm {
    position: relative;
    transition: all 0.3s ease;
}

#formError {
    transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

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

/* Product info display animation */
#productInfoDisplay {
    animation: fadeIn 0.3s ease-out;
    transition: all 0.2s ease;
}

/* Manual form select styling */
.select2-container--default .select2-selection--single {
    height: 42px;
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #D1D5DB;
    background-color: #FFFFFF;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #EF4444;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 1rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 0.5rem;
}

.select2-dropdown {
    border: 2px solid #EF4444;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #FEF2F2;
    color: #EF4444;
}

/* Toast customization */
.toastify {
    border-radius: 0.5rem;
    font-family: system-ui, -apple-system, sans-serif;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Success modal */
#successModal {
    backdrop-filter: blur(3px);
}

#successModal .bg-white {
    animation: fadeIn 0.3s ease-out;
}

/* Media queries for better responsiveness */
@media (max-width: 768px) {
    input[type="number"],
    input[type="text"],
    input[type="date"] {
        height: 48px;
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    #manualOrderForm .grid {
        gap: 1rem;
    }
}

/* Custom radio buttons */
input[type="radio"] {
    appearance: none;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    margin-right: 0.5em;
    transition: all 0.15s ease-in-out;
}

input[type="radio"]:checked {
    border-color: #EF4444;
    background-color: #EF4444;
    box-shadow: inset 0 0 0 3px white;
}

/* Table styles */
.table-container {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Hover effects */
.hover-scale {
    transition: transform 0.15s ease-in-out;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D1D5DB;
}

/* Catalog styles */
.brand-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.brand-card.active {
    border-color: #EF4444 !important;
    background-color: #FEF2F2;
    transform: translateY(-2px);
}

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.hover\:scale-102:hover {
    transform: scale(1.02);
}

/* Button styles */
#catalogBtn.active, #manualBtn.active, #uploadBtn.active {
    background-color: #FEF2F2;
    border-color: #EF4444;
    border-width: 2px;
    color: #EF4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Product modal styles */
#productModal {
    backdrop-filter: blur(5px);
}

#productModal .bg-white {
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#productModal.animate-in .bg-white {
    transform: scale(1);
}

#productModal.animate-out .bg-white {
    transform: scale(0.95);
}

.quantity-btn {
    transition: all 0.2s ease;
}

.quantity-btn:active {
    transform: scale(0.9);
}

#modalQuantityInput {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

#addToCartBtn {
    position: relative;
    overflow: hidden;
}

#addToCartBtn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

#addToCartBtn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Text pulse animation for price changes */
@keyframes textPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #EF4444;
    }
    100% {
        transform: scale(1);
    }
}

.text-pulse {
    animation: textPulse 0.3s ease-in-out;
}

/* Cart animation feedback */
@keyframes cartSuccess {
    0% {
        transform: translateY(0);
    }
    15% {
        transform: translateY(-15px);
    }
    30% {
        transform: translateY(0);
    }
    45% {
        transform: translateY(-7px);
    }
    60% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
    }
}

.cart-success {
    animation: cartSuccess 0.8s ease-out;
}

/* Cart badge styling and animation */
#cartBadge, #mobileCartBadge {
    animation: badgePulse 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Make cart icon clickable */
#cartIconContainer, #mobileCartIconContainer {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#cartIconContainer:hover, #mobileCartIconContainer:active {
    transform: scale(1.1);
    color: #EF4444;
}

/* Section highlight animation */
@keyframes sectionHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    30% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.2);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.highlight-section {
    animation: sectionHighlight 1.5s ease-out;
}

/* Mobile optimizations for product modal */
@media (max-width: 640px) {
    #productModal .bg-white {
        width: 92%;
        border-radius: 16px;
        max-height: 85vh;
    }
    
    .quantity-btn {
        width: 48px !important;
        height: 48px !important;
    }
    
    #modalQuantityInput {
        height: 48px;
        font-size: 1.25rem !important;
    }
    
    #addToCartBtn {
        width: 100%;
        padding: 12px 16px;
        margin-top: 8px;
    }
}

/* Add some mobile optimizations for catalog view */
@media (max-width: 640px) {
    /* Main container padding adjustments */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Order flow improvements */
    .bg-white {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    /* Welcome section */
    .bg-gradient-to-r {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .bg-gradient-to-r h1 {
        font-size: 1.5rem;
    }
    
    .bg-gradient-to-r p {
        font-size: 0.85rem;
    }
    
    /* Improve spacing between sections */
    .mb-6 {
        margin-bottom: 1rem;
    }
    
    .mb-8 {
        margin-bottom: 1.25rem;
    }
    
    /* Order actions buttons optimization */
    .order-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0 0.5rem;
        margin-bottom: 2rem;
    }
    
    .order-actions button {
        width: 100%;
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .order-actions button:last-child {
        grid-column: span 2;
    }
    
    #catalogBtn, #manualBtn, #uploadBtn {
        transition: all 0.2s ease;
        min-height: 80px;
        border-radius: 8px;
        padding: 0.75rem 0.5rem;
    }
    
    .brand-card {
        padding: 0.75rem;
    }
    
    .brand-card img {
        height: 3rem;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    #productsGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .product-card h4 {
        font-size: 0.95rem;
    }
    
    .product-card p {
        font-size: 0.75rem;
    }
    
    #catalogBtn.active, #manualBtn.active, #uploadBtn.active {
        background-color: #FEF2F2;
        border-color: #EF4444;
        transform: translateY(-3px);
    }
    
    #catalogBtn i, #manualBtn i, #uploadBtn i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    #catalogBtn h3, #manualBtn h3, #uploadBtn h3 {
        font-size: 0.8rem;
        margin-bottom: 0;
        text-align: center;
    }
}

/* Product card hover effects */
.product-card .bg-gradient-to-br {
    transition: all 0.3s ease;
}

.product-card:hover .bg-gradient-to-br {
    background: linear-gradient(to bottom right, #FEF2F2, #FEE2E2);
}

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

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

/* Modal animations */
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.animate-scale-in {
    animation: scaleIn 0.2s ease-out forwards;
}

/* Enhanced UI components */
:root {
    --primary-color: #EF4444;
    --primary-light: #FEF2F2;
    --primary-dark: #B91C1C;
    --gray-light: #F9FAFB;
    --gray-medium: #E5E7EB;
    --text-dark: #1F2937;
}

body {
    background-color: #F3F4F6;
    color: var(--text-dark);
}

/* Card styling enhancement */
.bg-white {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.bg-white:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Date selection section styling */
.date-selection-container {
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--gray-medium);
    transition: all 0.3s ease;
}

.date-selection-container:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

input[type="date"] {
    height: 46px;
    padding: 0 16px;
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    border: 2px solid var(--gray-medium);
    border-radius: 0.5rem;
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

input[type="date"]:hover {
    border-color: #D1D5DB;
    background: #ffffff;
}

input[type="date"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    outline: none;
}

/* Custom date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23EF4444" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Enhanced radio buttons */
.radio-container {
    display: flex;
    background-color: var(--gray-light);
    border-radius: 50px;
    border: 1px solid var(--gray-medium);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.radio-option {
   /* flex: 1;*/
    text-align: center;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.radio-option.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.radio-option:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Enhanced table styling */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
}

table thead {
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
}

table th {
    padding: 16px;
    font-weight: 600;
    color: #4B5563;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-medium);
}

table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-medium);
    font-size: 0.95rem;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Enhanced product cards */
.product-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(229, 231, 235, 0.5);
    background: white;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
    border-color: rgba(239, 68, 68, 0.3);
}

.product-card .bg-gradient-to-br {
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    padding: 2rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.product-card:hover .bg-gradient-to-br {
    background: linear-gradient(145deg, var(--primary-light), #FECACA);
}

.brand-card {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.brand-card.active {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.1), 0 4px 6px -2px rgba(239, 68, 68, 0.05);
    border-color: var(--primary-color) !important;
    transform: translateY(-5px) scale(1.02);
}

.brand-card:hover:not(.active) {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Enhanced buttons 
button {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
*/
button:active {
    transform: translateY(1px);
    box-shadow: none;
}

button.bg-red-500 {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    border: none;
}

button.bg-red-500:hover {
    background: linear-gradient(145deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

/* Mobile responsiveness enhancement */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    table th, table td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    table th:first-child, table td:first-child {
        padding-left: 16px;
    }
    
    table th:last-child, table td:last-child {
        padding-right: 16px;
    }
    
    input[type="date"] {
        width: 100%;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-card .bg-gradient-to-br {
        padding: 1rem;
    }
    
    .radio-option {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .brand-card img {
        height: 2.5rem;
    }
    
    .brand-card p {
        font-size: 0.8rem;
    }
    
    /* Stacked layout for date selection on mobile */
    .date-selection-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .date-selection-flex > div:first-child {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .date-selection-flex > div:last-child {
        width: 100%;
    }
    
    /* Improved modal for mobile */
    #productModal .bg-white {
        width: 90%;
        max-height: 85vh;
    }
    
    /* Fix buttons on mobile */
    .order-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .order-actions button {
        flex: 1 0 auto;
        min-width: 45%;
    }
}

/* Maintain existing styles */

/* File upload styling */
#dropZone {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-light);
    transition: all 0.3s ease;
}

#dropZone.drag-over {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    transform: scale(1.01);
}

#dropZone.uploading {
    pointer-events: none;
}

#dropZone.uploading::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

#dropZone.uploading::before {
    content: "Téléchargement...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-weight: 500;
    color: var(--primary-color);
}

#browseFilesBtn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Upload status animations */
@keyframes uploadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), #F87171);
    animation: uploadProgress 2s ease forwards;
}

/* File type icons */
.fa-file-pdf {
    color: #F56565;
}

.fa-file-word {
    color: #2B6CB0;
}

.fa-file-excel {
    color: #276749;
}

.fa-file-image {
    color: #9F7AEA;
}

/* Enhaned textarea */
textarea {
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.15s ease-in-out;
    border: 2px solid var(--gray-medium);
    border-radius: 0.5rem;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    outline: none;
}

/* Upload success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.upload-success {
    animation: successPulse 0.5s ease;
}

/* Mobile styling for upload section */
@media (max-width: 768px) {
    #dropZone {
        min-height: 180px;
        padding: 1rem;
    }
    
    #uploadedFileContainer {
        font-size: 0.9rem;
    }
    
    #uploadedFileContainer .bg-green-100 {
        padding: 0.5rem;
    }
}

/* Mobile optimizations for catalog products */
@media (max-width: 767px) {
    #productsGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card {
        border-radius: 8px;
        margin-bottom: 0;
        transform: none !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .product-card:hover {
        transform: none !important;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }
    
    .product-card .p-4 {
        padding: 10px;
    }
    
    .product-card .bg-gradient-to-br {
        padding: 10px;
        background: #f9fafb;
    }
    
    .product-card .h-32 {
        height: auto;
        min-height: 80px;
    }
    
    .product-card .h-20 {
        height: 60px;
    }
    
    .product-card h4.font-semibold {
        font-size: 0.85rem;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .product-card .text-sm {
        font-size: 0.75rem;
    }
    
    .product-card .text-xs {
        font-size: 0.7rem;
    }
    
    .product-card .flex.justify-between {
        align-items: center;
    }
    
    .product-card .bg-red-100 {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .product-card .bg-red-500 {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    /* Better tap targets for mobile */
    .product-card button {
        min-height: 28px;
        min-width: 70px;
    }
    
    /* Optimize product modal for mobile */
    #productModal .bg-white {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    #productModal .p-6 {
        padding: 12px;
    }
    
    #modalProductImage {
        height: 80px;
    }
    
    #modalQuantityInput {
        height: 40px;
    }
    
    #modalIncreaseQuantity, #modalDecreaseQuantity {
        padding: 8px 12px;
    }
    
    #modalNoteInput {
        height: 40px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #productsGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .product-card .flex.justify-between.items-center.mt-2 {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-card .text-red-600.font-bold {
        margin-top: 4px;
    }
    
    .product-card .mt-3.flex.justify-between.items-center {
        margin-top: 8px;
    }
    
    /* Stack price with size info for better readability */
    .product-card .text-sm.text-gray-600,
    .product-card .text-red-600.font-bold {
        width: 100%;
    }
    
    /* Make buttons more tappable on very small screens */
    .product-card button.bg-red-500 {
        padding: 4px 6px;
        border-radius: 4px;
        width: 100%;
        margin-top: 6px;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .product-card .text-xs.text-gray-500 {
        display: none; /* Hide the unit info on very small screens to save space */
    }
}

/* Additional mobile optimization styles */
.mobile-tag {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .mobile-tag {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .mobile-title {
        font-size: 0.9rem !important;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    .mobile-details {
        margin-top: 6px !important;
    }
    
    .mobile-actions {
        margin-top: 8px !important;
    }
    
    .mobile-add-btn {
        padding: 5px 10px !important;
        border-radius: 6px !important;
        font-size: 0.7rem !important;
    }
    
    /* Fix product grid spacing */
    #productsGrid {
        margin: 0 -4px;
    }
    
    /* Smoother scrolling */
    #catalogOrderSection {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .mobile-add-btn {
        width: 100%;
        margin-top: 6px;
    }
    
    .mobile-details {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mobile-details .text-red-600 {
        margin-top: 2px;
    }
    
    .mobile-unit {
        display: none;
    }
    
    .mobile-actions {
        flex-direction: column;
    }
}

/* Product search styling */
#productSearchInput {
    transition: all 0.2s ease;
    background-color: #f9fafb;
}

#productSearchInput:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

@media (max-width: 767px) {
    #productSearchInput {
        height: 42px;
        font-size: 0.9rem;
    }
    
    /* Make search more prominent on mobile */
    .relative.mb-4 {
        margin-bottom: 12px;
    }
    
    #productSearchInput::placeholder {
        font-size: 0.85rem;
    }
}

/* Navigation active state for mobile */
.mobile-link.active {
    background-color: #FEF2F2;
    color: #EF4444;
    border-left: 3px solid #EF4444;
    font-weight: 500;
}

/* Mobile-specific styles for order type cards */

/* Mobile floating action button */
#mobileOrderFab {
    animation: fadeInUp 0.3s ease-out;
    transition: all 0.3s ease;
}

#mobileOrderFab.fab-expanded {
    transform: scale(1.1);
}

#mobileValidateBtn {
    height: 56px;
    width: 56px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: scale(1);
    transition: all 0.2s ease;
}

#mobileValidateBtn:active {
    transform: scale(0.95);
}

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

/* Navigation active state for mobile */

/* Cart date picker styling */
.order-date-selector {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    border: 1px solid rgba(229, 231, 235, 0.7);
    padding: 0.5rem 0.75rem;
    background-color: #f9fafb;
}

.order-date-selector:hover {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#cartDatePicker {
    min-width: 140px;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    color: #1f2937;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23EF4444" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px;
    padding-right: 2rem;
}

#cartDatePicker:hover {
    border-color: #d1d5db;
    background-color: #ffffff;
}

#cartDatePicker:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Improve date picker display on Webkit browsers */
#cartDatePicker::-webkit-datetime-edit {
    padding: 0;
    color: #1f2937;
}

#cartDatePicker::-webkit-calendar-picker-indicator {
    opacity: 0; /* Hide default icon since we're using our own */
}

#cartDatePicker::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

#cartDatePicker::-webkit-datetime-edit-text,
#cartDatePicker::-webkit-datetime-edit-month-field,
#cartDatePicker::-webkit-datetime-edit-day-field,
#cartDatePicker::-webkit-datetime-edit-year-field {
    color: #1f2937;
    font-weight: 500;
}

.default-date-indicator {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

/* Mobile optimization for date selector */
@media (max-width: 640px) {
    .order-date-selector {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem;
    }
    
    .order-date-selector .text-sm {
        margin-bottom: 0.25rem;
    }
    
    #cartDatePicker {
        width: 100%;
    }
    
    #orderTotalSection {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #orderTotalSection p {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
}

#dateFallbackDisplay {
    padding: 0.375rem 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    min-width: 140px;
    text-align: center;
    color: #1f2937;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#dateFallbackDisplay:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#dateFallbackDisplay:active {
    background-color: #e5e7eb;
    transform: translateY(1px);
}

#dateFallbackDisplay::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23EF4444" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Ensure date picker is visible on all browsers */
#cartDatePicker.opacity-0 {
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

#cartDatePicker.opacity-0:focus + #dateFallbackDisplay {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Increase contrast for date value display */
input[type="date"] {
    color: #000000 !important;
    font-weight: 500;
}

.default-date-indicator {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}

.order-date-selector {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.order-date-selector:hover {
    transform: translateY(-1px);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-animation {
    animation: pulse 1.5s ease-out;
}

/* Mobile optimization for date selector */
@media (max-width: 640px) {
    .order-date-selector {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    #dateFallbackDisplay {
        width: 100%;
        justify-content: flex-start;
    }
}

@keyframes datepicker-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        background-color: #f9fafb;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        background-color: #fee2e2;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        background-color: #f9fafb;
    }
}

.animate-pulse {
    animation: datepicker-pulse 0.75s ease-out;
}

#dateFallbackDisplay {
    padding: 0.375rem 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    min-width: 140px;
    text-align: center;
    color: #1f2937;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Style spécifique pour mobile qui augmente la zone de toucher */
@media (max-width: 768px) {
    #dateFallbackDisplay {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        min-height: 42px;
    }
    
    .order-date-selector {
        margin-bottom: 1rem;
    }
}

/* Améliorer le focus sur le date picker sur iOS */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Indication claire de la possibilité de clic */
.date-interactive-indicator {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ef4444;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
