@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #ffe9db;
    --card-bg: #ffffff;
    --text-main: #4a4a4a;
    --text-light: #727272;
    --accent-color: #e5b0b1; /* Pastel rose */
    --pill-bg: #f3d8d9;
    --pill-text: #8c5a5b;
    --price-color: #6d8e78; /* Soft green */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
}

/** ===== Boton de whatsapp flotante ===== */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: -130px;
    background-color: #25D366;
    color: white;
    width: 170px;
    height: 40px;
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: left;
    padding-left: 10px;
    text-decoration: none;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    transition: ease 0.4s;
    z-index: 900;
}

.whatsapp-btn i {
    font-size: 30px;
}

.whatsapp-btn:hover {
    transform: translateX(-110px);
}

.whatsapp-numero {
    padding-left: 5px;
    font-weight: bold;
}


/* Header simple opcional */
.catalog-header {
    text-align: center;
    padding: 40px 20px 20px;
}

.catalog-header h1 {
    font-weight: 600;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.catalog-header p {
    font-weight: 400;
    color: var(--text-light);
}

/* Grid del catálogo */
.catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.catalog-grid {
    display: grid;
    /* Al menos 2 columnas en móviles */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Estilos de la Card */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Carrusel de imágenes */
.carousel-container {
    position: relative;
    width: 100%;
    /* Relación de aspecto cuadrada o similar */
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: #f0f0f0;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Botones del carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0;
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.carousel-btn.prev {
    left: 8px;
}

.carousel-btn.next {
    right: 8px;
}

/* Indicadores de carrusel */
.carousel-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.indicator.active {
    background: rgba(255, 255, 255, 0.9);
}

/* Contenido de la Card */
.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.2;
}

.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.pill {
    display: inline-block;
    background-color: var(--pill-bg);
    color: var(--pill-text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--price-color);
}

.footer-bottom-bar {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #5d375a;
    /* Línea divisoria sutil */
    font-size: 0.85em;
    color: #5d375a;
    /* Marrón medio */
}

/* Responsive */
@media (min-width: 576px) {
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .catalog-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-desc {
        font-size: 0.85rem;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* =========================================
   ESTILOS DEL CARRITO DE COMPRAS
   ========================================= */

/* Botón flotante para abrir el carrito */
.cart-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-toggle-btn:hover {
    transform: scale(1.05);
    background-color: #d19a9b;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff5252;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Botón Agregar al Carrito en la Tarjeta */
.card-content {
    position: relative; /* Para posicionar el botón de agregar al carrito */
}

.add-to-cart-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
    background-color: #d19a9b;
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

.item-cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff5252;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Animaciones para el carrito */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pop-anim {
    animation: pop 0.3s ease;
}

@keyframes bounceCart {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(15deg);}
    80% { transform: rotate(-20deg);}
    100% { transform: rotate(0deg); }
}

.bounce-anim {
    animation: bounceCart 0.3s ease;
}

/* Sidebar del Carrito */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1002;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.cart-sidebar.open {
    right: 0;
}

.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-cart-btn:hover {
    color: var(--text-main);
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart-message {
    text-align: center;
    color: var(--text-light);
    margin-top: 50px;
    font-style: italic;
}

/* Ítem del Carrito */
.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-aroma {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--price-color);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-main);
    transition: background-color 0.2s ease;
}

.qty-btn:hover {
    background-color: #f5f5f5;
}

.qty-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff5252;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.remove-item-btn:hover {
    transform: scale(1.1);
}

/* Footer del Carrito */
.cart-sidebar-footer {
    padding: 20px;
    background-color: #fcfcfc;
    border-top: 1px solid #eee;
}

.cart-summary {
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.total-price-row {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.checkout-btn:hover:not(:disabled) {
    background-color: #20b858;
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    background-color: #a5d6a7;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .cart-sidebar {
        max-width: 100%;
    }
}
