/* Mobile Product Carousel - Horizontal Scrolling */
.mobile-product-carousel {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    background: var(--crema-claro);
    border-radius: 16px;
    margin: 20px 0;
}

.carousel-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.carousel-title {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    color: var(--vino-tinto-medio);
    margin-bottom: 8px;
}

.carousel-subtitle {
    color: var(--texto-oscuro);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    padding: 0 40px; /* Space for navigation buttons */
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 0 20px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* Product Cards */
.product-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 400px; /* Increased height for better spacing */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(138, 0, 40, 0.15);
}

.product-card-image-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.product-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--crema-oscuro);
    transition: transform 0.3s ease;
}

.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(138, 0, 40, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card-image-container:hover .product-image-overlay,
.product-card-image-container:active .product-image-overlay {
    opacity: 1;
}

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

.overlay-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overlay-text i {
    font-size: 1.2rem;
}

.product-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-name {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    color: var(--vino-tinto-oscuro);
    margin-bottom: 8px;
    font-weight: 600;
}

.product-card-description {
    font-size: 0.85rem;
    color: var(--texto-oscuro);
    margin-bottom: 12px;
    line-height: 1.4;
    opacity: 0.85;
    text-align: left;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px; /* Approximately 2 lines */
    max-height: 42px;
}

.product-card-price {
    font-size: 1.2rem;
    color: var(--vino-tinto-medio);
    font-weight: 700;
    margin-bottom: 16px;
}

/* Quantity Selector in Card */
.product-card-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--crema-claro);
    border-radius: 8px;
}

.quantity-label {
    font-size: 0.9rem;
    color: var(--texto-oscuro);
    font-weight: 500;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--vino-tinto-medio);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.quantity-btn:hover {
    background: var(--vino-tinto-oscuro);
    transform: scale(1.1);
}

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

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vino-tinto-medio);
}

/* Action Buttons */
.product-card-actions {
    display: flex;
    gap: 8px;
}

.btn-customize {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--dorado-acento);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-quick {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--vino-tinto-medio);
    background: white;
    color: var(--vino-tinto-medio);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-customize:hover {
    background: #B8941F;
    transform: translateY(-1px);
}

.btn-add-quick:hover {
    background: var(--vino-tinto-medio);
    color: white;
}

/* Unified button - same experience as desktop */
.btn-customize-and-add {
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: var(--vino-tinto-medio);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(138, 0, 40, 0.2);
}

.btn-customize-and-add:hover {
    background: var(--vino-tinto-oscuro);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(138, 0, 40, 0.3);
}

.btn-customize-and-add:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(138, 0, 40, 0.2);
}

.btn-customize-and-add.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-customize-and-add.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--vino-tinto-medio);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 2;
}

.carousel-nav:hover {
    background: var(--vino-tinto-oscuro);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 4px;
}

.carousel-nav.next {
    right: 4px;
}

.carousel-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crema-oscuro);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background: var(--vino-tinto-medio);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .carousel-container {
        padding: 0;
    }
    
    .carousel-track {
        padding: 0 16px 16px;
    }
    
    .product-card {
        flex: 0 0 260px;
        height: 380px; /* Better spacing for mobile */
    }
    
    .carousel-nav {
        display: none; /* Hide nav buttons on mobile, use swipe */
    }
    
    .product-card-image {
        height: 160px;
    }
    
    /* Mobile touch-friendly overlay */
    .product-image-overlay {
        background: rgba(138, 0, 40, 0.9);
    }
    
    .product-card-description {
        font-size: 0.8rem;
        line-height: 1.4;
        min-height: 42px; /* 2 lines for mobile */
        max-height: 42px;
        -webkit-line-clamp: 2;
    }
    
    .btn-customize,
    .btn-add-quick {
        min-height: 44px; /* Touch target compliance */
    }
    
    .quantity-btn {
        width: 44px;
        height: 44px;
    }
}

/* Quick Add Notification */
.quick-add-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--vino-tinto-medio);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: transform 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.quick-add-notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-content i {
    color: #4CAF50;
}

/* Loading State */
.product-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--crema-oscuro);
    border-top-color: var(--vino-tinto-medio);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success Animation */
@keyframes addToCartSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        background: #27ae60;
    }
    100% {
        transform: scale(1);
    }
}

.product-card.added {
    animation: addToCartSuccess 0.5s ease;
}

/* Customization Modal Improvements */
.customization-modal {
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-quantity-section {
    background: var(--crema-claro);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.modal-quantity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-quantity-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vino-tinto-oscuro);
}

.modal-quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-quantity-display {
    min-width: 60px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--vino-tinto-medio);
}

/* Add to Cart Button Enhancement */
.modal-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--vino-tinto-medio);
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 20px;
}

.modal-add-to-cart:hover {
    background: var(--vino-tinto-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 0, 40, 0.25);
}

.modal-add-to-cart .price-total {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-add-to-cart .btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

.carousel-track {
    will-change: transform;
}

.product-card {
    will-change: transform, box-shadow;
}