/* web/css/tienda.css */
/* Colores Elegantes y Oscuros: Azul, Rojo y Verde */
:root {
    --store-primary: #1b263b; /* Azul oscuro elegante */
    --store-secondary: #780000; /* Rojo oscuro elegante */
    --store-accent: #1e5631; /* Verde esmeralda oscuro */
    --store-bg: #f4f6f9;
    --store-card: #ffffff;
    --store-text: #333333;
    --store-light: #e0e1dd;
}

body {
    background-color: var(--store-bg);
}

.tienda-navbar {
    background-color: var(--store-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tienda-navbar .nav-link,
.tienda-navbar .icon-link,
.tienda-navbar .search-bar button {
    color: #ffffff;
}

.tienda-navbar .nav-link:hover,
.tienda-navbar .nav-link.active {
    color: #4CAF50; /* Un verde más brillante solo para hover */
}

.tienda-main {
    padding: 40px 0;
}

.page-title {
    color: var(--store-primary);
    font-size: 2.5rem;
    margin-bottom: 5px;
    border-bottom: 3px solid var(--store-secondary);
    display: inline-block;
    padding-bottom: 10px;
}

.page-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Grilla de Tienda */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Tarjeta de Producto */
.product-card {
    background: var(--store-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--store-accent);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Relación de aspecto 1:1 */
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.1rem;
    color: var(--store-primary);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.product-price {
    font-size: 1.4rem;
    color: #000000;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-add-cart {
    background-color: var(--store-accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: auto;
    font-weight: bold;
}

.btn-add-cart:hover {
    background-color: #143e22;
}

.btn-add-cart i {
    margin-right: 8px;
}

.vendor-badge {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

/* Badge de Carrito */
.position-relative {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--store-secondary);
    color: white;
    font-size: 0.7rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Loader */
.loader-container {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--store-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 992px) {
    .store-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .tienda-navbar {
        display: flex;
        flex-direction: column;
        padding: 10px;
    }
    .tienda-navbar .search-bar {
        width: 100%;
        margin: 10px 0;
    }
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .product-info {
        padding: 10px;
    }
    .product-title {
        font-size: 0.9rem;
    }
    .product-price {
        font-size: 1.1rem;
    }
    .btn-add-cart {
        padding: 8px;
        font-size: 0.9rem;
    }
}
@media (max-width: 480px) {
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
