/* public/css/style.css */

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #FFFFFF;
    /* Relleno superior para compensar la barra de navegación fija */
    padding-top: 70px;
}

main {
    flex: 1;
}

/* --- Barra de Navegación --- */
.navbar {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #EAEAEA;
}
.navbar .navbar-brand, .navbar .nav-link {
    color: #212529 !important;
    font-weight: 500;
}
.navbar .navbar-brand:hover, .navbar .nav-link:hover {
    color: #3D405B !important;
}
.navbar .badge {
    background-color: #3D405B !important;
    color: #FFFFFF !important;
}

/* --- Tarjeta de Producto --- */
.product-card {
    transition: all 0.3s ease-in-out;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    position: relative; /* Añadido para el ícono de favorito */
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.product-card .card-img-container {
    height: 250px; /* Altura fija para el contenedor de la imagen */
    overflow: hidden; /* Oculta cualquier parte de la imagen que se desborde */
    display: flex; /* Para centrar la imagen si es más pequeña */
    align-items: center; /* Centrado vertical */
    justify-content: center; /* Centrado horizontal */
}

.product-card .card-img-top {
    width: 100%; /* La imagen ocupa todo el ancho del contenedor */
    height: 100%; /* La imagen ocupa toda la altura del contenedor */
    object-fit: contain; /* **CORRECCIÓN:** Asegura que la imagen completa sea visible sin ser recortada */
    border-radius: 8px 8px 0 0;
}
.product-card .card-body {
    flex-grow: 1;
}
.product-card .card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #212529;
}
.product-card .card-subtitle {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #3D405B;
}
.product-card .btn-dark {
    background-color: #3D405B;
    border-color: #3D405B;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s;
}
.product-card .btn-dark:hover {
    background-color: #212529;
    border-color: #212529;
}

/* --- Ícono de Favorito --- */
.favorite-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.favorite-icon .fa-heart {
    color: #aaa;
    font-size: 18px;
    transition: all 0.3s ease;
}
.favorite-icon.favorited .fa-heart,
.favorite-icon:hover .fa-heart {
    color: #e53935; /* Corazón rojo */
    transform: scale(1.15);
}

/* --- Pie de Página --- */
footer {
    background-color: #F4F4F9 !important;
    color: #212529 !important;
    padding: 2rem 0;
}

/* --- Estilos para el sidebar de filtros responsivo --- */
.filter-sidebar {
    padding: 0;
    background: #fff;
    border-radius: 5px;
}
.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    top: 0;
    left: 0;
}

/* ===== INICIO DE LA CORRECCIÓN PARA FILTRO MÓVIL ===== */
@media (max-width: 991.98px) {
    .filter-sidebar {
        position: fixed; top: 0; left: 0; height: 100%; width: 300px;
        z-index: 999; transition: all 0.3s;
        transform: translateX(-100%);
        box-shadow: 3px 0px 15px rgba(0,0,0,0.2);
        display: flex; /* Usamos flexbox para la estructura interna */
        flex-direction: column;
    }
    .filter-sidebar.active { transform: translateX(0); }
    .overlay.active { display: block; }
    
    .sidebar-header {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid #dee2e6;
        flex-shrink: 0; /* El header no se encoge */
        background-color: #fff; /* Fondo para que no se vea el contenido al hacer scroll */
        position: sticky; /* Hacemos que el header se quede fijo arriba */
        top: 0;
        z-index: 2; /* Asegura que esté por encima del contenido que se desplaza */
    }

    /* Contenedor para los filtros que sí se van a desplazar */
    .filter-sidebar form {
        flex-grow: 1; /* Ocupa el espacio restante */
        overflow-y: auto; /* Habilita el scroll vertical solo en esta sección */
        padding: 1.25rem; /* Añadimos el padding aquí */
    }
}
/* ===== FIN DE LA CORRECCIÓN ===== */


@media (max-width: 576px) {
    .product-card .card-img-top {
        height: 180px;
    }
    .product-card .card-title {
        font-size: 1rem;
    }
    .product-card .card-text {
        font-size: 0.9rem;
    }
    .product-card .price {
        font-size: 1.1rem;
    }
}

/* --- ESTILOS PARA VISTA DE LISTA --- */
@media (max-width: 767.98px) {
    #product-grid.list-view .col {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    #product-grid.list-view .product-card {
        flex-direction: row;
        height: auto;
    }
    #product-grid.list-view .card-img-container {
        /* INICIO DE LA DOBLE MODIFICACIÓN PARA MEJORAR LA VISTA EN LISTA MÓVIL */
        /* 1. Aumentamos el ancho y eliminamos la altura fija para reducir el espacio vertical */
        width: 120px; /* MODIFICADO: De 100px a 120px */
        height: auto; /* AÑADIDO/MODIFICADO: Permite que la altura se ajuste al contenido, reduciendo el espacio en blanco */
        /* 2. Alineamos el contenido de texto para un mejor balance */
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Alinea la imagen a la izquierda/arriba */
        /* FIN DE LA DOBLE MODIFICACIÓN */
        flex-shrink: 0;
        position: relative; /* Contenedor para el ícono de favorito */
    }
    #product-grid.list-view .card-img-top {
        height: 100%;
        width: 120px; /* MODIFICADO: De 100px a 120px */
        object-fit: contain;
        border-radius: 8px 0 0 8px;
    }
    #product-grid.list-view .product-card > a {
        display: flex;
        flex-grow: 1;
    }
    #product-grid.list-view .card-body {
        padding: 0.75rem 1rem;
        text-align: left;
    }
    #product-grid.list-view .card-footer {
        border-top: none;
        padding: 0 1rem;
        display: flex;
        align-items: center;
    }
    #product-grid.list-view .card-footer .btn {
        width: auto;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    .view-toggle-btn.active {
        background-color: #3D405B;
        color: white;
    }
    
    /* Mueve el ícono de favorito dentro de la imagen en la vista de lista */
    #product-grid.list-view .favorite-icon {
        position: absolute;
        top: 5px; /* Menor distancia desde arriba */
        right: 5px; /* Menor distancia desde la derecha */
        width: 30px; /* Más pequeño */
        height: 30px;
    }
    #product-grid.list-view .favorite-icon .fa-heart {
        font-size: 14px; /* Icono más pequeño */
    }
}

/* --- ESTILOS PARA EL NOMBRE DE LA MARCA --- */
.brand-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
}
.brand-part-1 {
    color: #3D405B;
}
.brand-part-2 {
    color: #C0A774;
}
@media (max-width: 576px) {
    .brand-text {
        font-size: 1rem;
    }
}

/* --- TABLA RESPONSIVA MIS PEDIDOS --- */
@media (max-width: 767.98px) {
    .responsive-table thead {
        display: none;
    }
    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .25rem;
    }
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .75rem;
        border-bottom: 1px solid #dee2e6;
        text-align: right;
    }
    .responsive-table td:last-child {
        border-bottom: 0;
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        margin-right: 1rem;
    }
}

/* --- VISTA DE CARRITO RESPONSIVA FINAL --- */

.cart-item {
    display: flex;
    align-items: flex-start; /* Alinea los items arriba */
    padding: 1rem 0;
    border-bottom: 1px solid #eaeaea;
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-image {
    flex: 0 0 100px; /* Ancho fijo para la imagen */
}
.cart-item-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.cart-item-details {
    flex-grow: 1;
    padding: 0 1rem;
}
.cart-item-title {
    font-size: 1.1rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.25rem;
}
.cart-item-actions {
    flex: 0 0 200px; /* Ancho fijo para las acciones */
    text-align: right;
}
.cart-quantity-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.5rem;
}
.cart-quantity-form .form-control {
    width: 60px;
    text-align: center;
}
.cart-item-subtotal {
    font-size: 1.1rem;
}
.cart-item-remove {
    flex: 0 0 50px;
    text-align: right;
}

/* Media Query para la vista móvil */
@media (max-width: 767.98px) {
    .cart-item {
        flex-wrap: wrap; /* Permite que los elementos se organicen verticalmente */
    }
    .cart-item-image {
        flex: 0 0 80px; /* Imagen más pequeña en móvil */
    }
    .cart-item-details {
        flex: 1 1 calc(100% - 120px); /* Ocupa el espacio restante al lado de la imagen */
    }
    .cart-item-title {
        font-size: 1rem;
    }
    .cart-item-price {
        font-size: 0.9rem;
    }
    .cart-item-remove {
        flex: 0 0 40px; /* Espacio para el botón de eliminar */
        order: 2; /* Mueve el botón de eliminar al final de la primera línea */
    }
    .cart-item-actions {
        flex: 1 1 100%; /* Ocupa toda la segunda línea */
        margin-top: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

/* --- Estilos para Gift Cards --- */
.gift-card-option {
    display: block;
    cursor: pointer;
    user-select: none;
}

.gift-card-option .form-check-input {
    display: none;
}

.gift-card-content {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gift-card-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.gift-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transform: skewX(-30deg);
    transition: all 0.4s ease-in-out;
}

.gift-card-content:hover::before {
    left: 100%;
}

.gift-card-option .form-check-input:checked + .gift-card-content {
    border-color: #C0A774;
    background: linear-gradient(135deg, #FFF9EB, #FCECD7);
    box-shadow: 0 8px 25px rgba(192, 167, 116, 0.25);
    transform: translateY(-3px);
}

.gift-card-option .form-check-input:checked + .gift-card-content .gift-card-amount {
    color: #3D405B;
}

.gift-card-option .form-check-input:checked + .gift-card-content .gift-card-text {
    color: #6c757d;
}

.gift-card-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.gift-card-amount {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #3D405B;
    line-height: 1;
}

.gift-card-amount-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
}

.usdt-logo {
    height: 1.5em;
    width: auto;
    vertical-align: middle;
}

.step-container {
    display: none;
}
.step-container.active {
    display: block;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

@media (max-width: 767px) {
    .gift-card-content {
        padding: 0.8rem;
    }
    .gift-card-amount {
        font-size: 1.6rem;
    }
    .usdt-logo {
        height: 1.3em;
    }
}

/* --- ESTILOS DE NAVEGACIÓN MÓVIL Y FOOTER --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-nav .nav-items {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav .nav-item {
    flex-grow: 1;
}

.mobile-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    color: #3D405B;
    text-decoration: none;
    font-size: 12px;
}

.mobile-nav .nav-link i {
    font-size: 20px;
    margin-bottom: 4px;
}

.mobile-nav .nav-link.active {
    color: #E07A5F;
}

@media (max-width: 768px) {
    footer.footer-public {
        display: none; /* Ocultar el footer tradicional en móviles */
    }
    
    .mobile-nav {
        display: block; /* Mostrar la barra de navegación en móviles */
    }
    
    body {
        /* Añadir espacio en la parte inferior para que el contenido no quede oculto detrás de la nav bar */
        padding-bottom: 70px;
    }
}

/* --- ESTILOS PARA EL CONTADOR DEL CARRITO MÓVIL --- */
.mobile-nav .nav-link .nav-icon-wrapper {
    position: relative;
    display: inline-block;
}

.mobile-nav .cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    border: 1px solid white;
}