/**
 * Yurcom Click & Collect - Style Uber Eats
 * Version: 1.1.2
 * Style moderne et responsive
 */

/* Reset et base */
.yurcom-menu-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #2e2e2e;
    background: #fff;
    margin: 0;
    padding: 0;
}

.yurcom-menu-container * {
    box-sizing: border-box;
}

/* Navigation sticky des catégories - Avec flèches discrètes à droite */
.yurcom-categories-nav {
    position: sticky;
    top: 100px; /* Offset pour header Astra */
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 16px 0;
    margin-bottom: 24px;
    z-index: 100;
}

.yurcom-categories-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
}

.yurcom-categories-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
    margin-right: 12px; /* Espace pour les flèches */
}

.yurcom-categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Flèches de navigation - Style Uber Eats discret à droite */
.yurcom-nav-arrows {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.yurcom-nav-arrow {
    width: 28px;
    height: 28px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: #666;
}

.yurcom-nav-arrow:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.yurcom-nav-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.yurcom-nav-arrow.disabled:hover {
    background: #f8f8f8;
    border-color: #e8e8e8;
}

/* Ajustement pour mobile */
@media (max-width: 768px) {
    .yurcom-categories-nav {
        top: 70px;
        padding: 12px 0;
    }
}

.yurcom-category-btn {
    display: inline-block;
    background: transparent;
    border: none;
    padding: 12px 20px;
    margin-right: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #676767;
    cursor: pointer;
    border-radius: 24px;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
}

.yurcom-category-btn:hover {
    background: #f6f6f6;
    color: #2e2e2e;
}

.yurcom-category-btn.active {
    background: #000;
    color: #fff;
    font-weight: 600;
}

.yurcom-category-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Container des produits */
.yurcom-products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Sections des catégories */
.yurcom-category-section {
    margin-bottom: 24px;
}

.yurcom-category-title {
    font-size: 1.3rem !important;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #111;
    padding: 0;
    line-height: 1.2;
}

/* Grille des produits - Style Uber Eats horizontal 2x2 */
.yurcom-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Responsive mobile - 1 colonne sur petit écran */
@media (max-width: 768px) {
    .yurcom-products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Cartes produits - Style Uber Eats horizontal avec bordure */
.yurcom-product-card {
    display: flex;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px; /* Border radius plus prononcé */
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Ombre légère */
}

.yurcom-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
    transform: translateY(-1px); /* Léger effet de lift */
}

/* Info produit à gauche */
.yurcom-product-info {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* Pour permettre l'ellipsis */
}

.yurcom-product-name {
    font-size: 1.225rem !important;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.2;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yurcom-product-description {
    font-size: 14px;
    color: #676767;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    min-height: 42px; /* Assure un espace minimum même si vide */
}

.yurcom-product-footer {
    margin-top: auto;
}

.yurcom-product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

/* Image produit à droite - Cover parfait sans encarts */
.yurcom-product-image {
    position: relative;
    width: 120px;
    height: 140px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f7f7f7;
    border-radius: 0 12px 12px 0; /* Border radius pour suivre la carte */
}

.yurcom-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover pour remplir complètement */
    object-position: center; /* Centrer l'image */
    display: block;
    border-radius: 0; /* Pas de border-radius sur l'image elle-même */
}

/* Image de remplacement SVG - Taille exacte */
.yurcom-product-image .yurcom-placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bouton d'ajout circulaire style Uber Eats */
.yurcom-add-to-cart-btn {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    z-index: 10;
}

.yurcom-add-to-cart-btn::before {
    content: '+' !important;
    font-size: 1.25rem !important;
    color: #fff !important;
    line-height: 1 !important;
}

.yurcom-add-to-cart-btn:hover {
    background: #333 !important;
}

.yurcom-add-to-cart-btn.loading {
    background: #666 !important;
    cursor: not-allowed !important;
}

.yurcom-add-to-cart-btn.loading::before {
    content: '⟳' !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .yurcom-products-container {
        padding: 0 12px;
    }
    
    .yurcom-category-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .yurcom-products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .yurcom-product-card {
        min-height: 120px;
    }
    
    .yurcom-product-image {
        width: 120px;
        height: 120px;
    }
    
    .yurcom-product-info {
        padding: 12px;
    }
    
    .yurcom-product-name {
        font-size: 15px;
    }
    
    .yurcom-product-description {
        font-size: 13px;
    }
}

/* Popup panier */
.yurcom-cart-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.yurcom-cart-popup.show {
    opacity: 1;
    visibility: visible;
}

.yurcom-cart-popup-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.yurcom-cart-popup.show .yurcom-cart-popup-content {
    transform: translateY(0);
}

.yurcom-cart-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.yurcom-cart-popup-title {
    font-size: 20px;
    font-weight: 600;
    color: #2e2e2e;
    margin: 0;
}

.yurcom-cart-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #676767;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.yurcom-cart-popup-close:hover {
    background: #f6f6f6;
}

.yurcom-cart-items {
    margin-bottom: 20px;
}

.yurcom-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f6f6f6;
}

.yurcom-cart-item:last-child {
    border-bottom: none;
}

.yurcom-cart-item-info {
    flex: 1;
}

.yurcom-cart-item-name {
    font-weight: 500;
    color: #2e2e2e;
    display: block;
    margin-bottom: 4px;
}

.yurcom-cart-item-quantity {
    font-size: 14px;
    color: #676767;
}

.yurcom-cart-item-price {
    font-weight: 600;
    color: #2e2e2e;
}

.yurcom-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 2px solid #e8e8e8;
    margin-bottom: 20px;
}

.yurcom-cart-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #2e2e2e;
}

.yurcom-cart-total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2e2e2e;
}

.yurcom-cart-actions {
    display: flex;
    gap: 12px;
}

.yurcom-cart-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
}

.yurcom-cart-btn-continue {
    background: #f6f6f6;
    color: #2e2e2e;
}

.yurcom-cart-btn-continue:hover {
    background: #e8e8e8;
}

.yurcom-cart-btn-checkout {
    background: #000;
    color: #fff;
}

.yurcom-cart-btn-checkout:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

/* Notifications */
.yurcom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.yurcom-notification.show {
    transform: translateX(0);
}

.yurcom-notification.error {
    background: #dc3545;
}

.yurcom-notification.success {
    background: #28a745;
}

/* Animation de chargement pour le compteur panier */
.yurcom-loading {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


/* ========================================
 * GESTION DU PANIER - SUPPRESSION ET QUANTITÉS
 * ======================================== */

/* Contrôles de quantité dans le popup panier */
.yurcom-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.yurcom-quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 2px;
}

.yurcom-quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yurcom-quantity-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.yurcom-quantity-input {
    width: 40px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    outline: none;
}

.yurcom-quantity-input:focus {
    background: #fff;
    border-radius: 4px;
}

.yurcom-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yurcom-remove-item:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Animation de suppression */
.yurcom-cart-item.removing {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* ========================================
 * CONTRÔLES CHECKOUT PAGE
 * ======================================== */

/* Contrôles sur la page de commande */
.yurcom-checkout-controls {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yurcom-checkout-controls .yurcom-quantity-controls {
    align-self: flex-start;
}

.yurcom-remove-checkout-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.yurcom-remove-checkout-item:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Animation pour les lignes de commande en cours de suppression */
.cart_item.removing {
    opacity: 0.5;
    background: #fff5f5;
    transition: all 0.3s ease;
}

/* ========================================
 * RESPONSIVE MOBILE
 * ======================================== */

@media (max-width: 768px) {
    .yurcom-cart-item-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .yurcom-checkout-controls {
        padding: 8px;
    }
    
    .yurcom-quantity-controls {
        gap: 2px;
    }
    
    .yurcom-quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .yurcom-quantity-input {
        width: 45px;
        height: 32px;
        font-size: 16px;
    }
}

/* ========================================
 * AMÉLIORATIONS POPUP PANIER
 * ======================================== */

/* Mise à jour du style des items du panier */
.yurcom-cart-item {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    border-bottom: 1px solid #f6f6f6;
    transition: all 0.3s ease;
}

.yurcom-cart-item:last-child {
    border-bottom: none;
}

.yurcom-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yurcom-cart-item-name {
    font-weight: 600;
    color: #2e2e2e;
    font-size: 15px;
}

.yurcom-cart-item-price {
    font-weight: 700;
    color: #2e2e2e;
    font-size: 16px;
    align-self: flex-end;
    margin-top: 8px;
}

/* États de chargement */
.yurcom-cart-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.yurcom-quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.yurcom-quantity-btn:disabled:hover {
    background: transparent;
}



/* ========================================
 * MASQUER LES FLÈCHES DES CHAMPS NUMBER
 * ======================================== */

/* Masquer les flèches de défilement des input number */
.yurcom-quantity-input::-webkit-outer-spin-button,
.yurcom-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.yurcom-quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* Masquer aussi pour tous les inputs number dans les contrôles checkout */
.yurcom-checkout-controls input[type=number]::-webkit-outer-spin-button,
.yurcom-checkout-controls input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.yurcom-checkout-controls input[type=number] {
    -moz-appearance: textfield;
}

