/* ================================================
   VISTA CUADRÍCULA 3x3 - tienda-grid.css
   Para usar junto con tienda.css
   ================================================ */

/* ── Selector de vistas ── */
.view-toggle-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.view-toggle-bar span {
    font-weight: 600;
    color: #555;
    margin-right: 4px;
    font-size: 14px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #888;
    transition: all 0.25s ease;
    position: relative;
}

.view-btn:hover {
    border-color: #ffecac;
    color: #5a5a5a;
    background: #f5f6ff;
}

.view-btn.active {
    border-color: #595959;
    background: #636363;
    color: #fff;
    box-shadow: 0 3px 10px rgba(118, 118, 118, 0.35);
}

.view-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
}

/* ── Ocultar/mostrar secciones según modo ── */
.products-slider-container {
    display: block;
}

.products-grid-container {
    display: none;
}

body.view-grid .products-slider-container {
    display: none;
}

body.view-grid .products-grid-container {
    display: block;
}

/* ── Grid 3 columnas ── */
.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 30px;
}

/* ── Tarjeta de producto en grid ── */
.grid-product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.grid-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
}

/* Badge de descuento */
.grid-product-card .discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.4);
}

/* Badge destacado */
.grid-product-card .featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #333;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(247, 151, 30, 0.4);
}

/* Imagen */
.grid-product-card .product-image {
    width: 100%;
    padding-top: 72%;           /* ratio 4:3 aprox */
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.grid-product-card .product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(102, 126, 234, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-product-card:hover .product-overlay {
    opacity: 1;
}

.grid-product-card .btn-view-product {
    background: #fff;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 7px;
}

.grid-product-card .btn-view-product:hover {
    background: #667eea;
    color: #fff;
}

/* Info del producto */
.grid-product-card .product-info {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.grid-product-card .product-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.grid-product-card .category-tag,
.grid-product-card .brand-tag {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 600;
}

.grid-product-card .category-tag {
    background: #eef0ff;
    color: #667eea;
}

.grid-product-card .brand-tag {
    background: #fff3e0;
    color: #e65100;
}

.grid-product-card .product-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ════════════════════════════════════════════
   ESTRELLAS PRECISAS
   ★ llena  → color amarillo #FFC107
   ½ media  → color amarillo #FFC107
   ☆ vacía  → color gris claro #DEDEDE

   Se aplica a: grid, slider, hero tienda
   y tiendas relacionadas.
   ════════════════════════════════════════════ */

/* Contenedor común */
.product-rating .stars,
.rating-section .stars,
.related-store-rating .stars {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

/* ── Estrella LLENA → amarillo ── */
.product-rating .stars .fa-star,
.rating-section .fa-star,
.related-store-rating .fa-star {
    color: #FFC107;
}

/* ── Media estrella → amarillo ── */
.product-rating .stars .fa-star-half-o,
.product-rating .stars .fa-star-half-alt,
.rating-section .fa-star-half-o,
.rating-section .fa-star-half-alt,
.related-store-rating .fa-star-half-o,
.related-store-rating .fa-star-half-alt {
    color: #FFC107;
}

/* ── Estrella VACÍA → gris claro ── */
.product-rating .stars .fa-star-o,
.rating-section .fa-star-o,
.related-store-rating .fa-star-o {
    color: #DEDEDE;
}

/* Tamaño en grid */
.grid-product-card .product-rating .stars .fa-star,
.grid-product-card .product-rating .stars .fa-star-half-o,
.grid-product-card .product-rating .stars .fa-star-half-alt {
    font-size: 13px;
    color: #FFC107;
}

.grid-product-card .product-rating .stars .fa-star-o {
    font-size: 13px;
    color: #DEDEDE;
}

/* Tamaño en slider */
.product-slider-item .product-rating .stars .fa-star,
.product-slider-item .product-rating .stars .fa-star-half-o,
.product-slider-item .product-rating .stars .fa-star-half-alt {
    font-size: 14px;
    color: #FFC107;
}

.product-slider-item .product-rating .stars .fa-star-o {
    font-size: 14px;
    color: #DEDEDE;
}

/* ── Rating info ── */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.grid-product-card .product-rating .rating-value {
    font-weight: 700;
    color: #555;
    font-size: 12px;
}

.grid-product-card .product-rating .review-count {
    color: #aaa;
    font-size: 11px;
}

.grid-product-card .no-rating {
    font-size: 11px;
    color: #bbb;
    font-style: italic;
}

/* Precios */
.grid-product-card .price-section {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.grid-product-card .price {
    font-size: 18px;
    font-weight: 800;
    color: #222;
}

.grid-product-card .discounted-price {
    font-size: 18px;
    font-weight: 800;
    color: #e53935;
}

.grid-product-card .original-price {
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    text-decoration: line-through;
}

/* Detalles variantes / stock */
.grid-product-card .product-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #999;
    margin-top: auto;
}

.grid-product-card .product-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Paginación ── */
.grid-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.page-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: #f5f6ff;
}

.page-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    padding: 0 6px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .grid-3x3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .grid-3x3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .grid-product-card .product-info {
        padding: 10px 12px 14px;
    }

    .grid-product-card .product-title {
        font-size: 13px;
    }

    .grid-product-card .price,
    .grid-product-card .discounted-price {
        font-size: 15px;
    }

    .view-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .grid-3x3 {
        grid-template-columns: 1fr;
    }
}