/* Tipografía y base */
body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Navbar */
.navbar {
    background-color: #212529;
}
.navbar .nav-link {
    color: #fff !important;
    margin-right: 15px;
}
.navbar .nav-link:hover {
    color: #28a745 !important;
}

/* Header logo */
.navbar-brand img {
    height: 35px;
    margin-right: 10px;
}

/* Botones */
.btn-primary {
    background-color: #007bff;
    border: none;
}
.btn-primary:hover {
    background-color: #0056b3;
}
.btn-success {
    background-color: #28a745;
    border: none;
}
.btn-success:hover {
    background-color: #1e7e34;
}

/* Cards de producto */
.card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-5px);
}
.card-title {
    font-size: 1rem;
    font-weight: bold;
}
.card-text {
    font-size: 0.9rem;
    color: #555;
}
.card .text-primary {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Footer */
footer {
    background-color: #212529;
    color: #ccc;
    padding: 20px 0;
    text-align: center;
}
footer a {
    color: #28a745;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Responsive: pantallas pequeñas */
@media (max-width: 768px) {
    h2 {
        font-size: 1.2rem;
    }
    .card {
        margin-bottom: 15px;
    }
    .navbar-brand img {
        height: 28px;
    }
    .btn {
        width: 100%;
        margin-top: 5px;
    }
}

/* ============================================
   BANNER OVERLAY
   ============================================ */
.banner-carousel-item {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
}
.banner-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 30px 25px 30px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    border-radius: 0 0 12px 12px;
}
.banner-overlay h2 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}
.banner-overlay .btn-ver-mas {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 10px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.banner-overlay .btn-ver-mas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.6);
}
@media (max-width: 768px) {
    .banner-carousel-item { height: 250px; }
    .banner-overlay h2 { font-size: 1.3rem; }
    .banner-overlay { padding: 30px 15px 15px 15px; }
}
@media (max-width: 576px) {
    .banner-carousel-item { height: 200px; }
    .banner-overlay h2 { font-size: 1.1rem; }
    .banner-overlay .btn-ver-mas { padding: 8px 20px; font-size: 0.85rem; }
}

/* ============================================
   IMÁGENES - OBJECT-FIT
   ============================================ */
.banner-img,
.banner-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.category-card-img {
    width: 100%;
    height: 250px;
    object-fit: contain !important;
    object-position: center;
    border-radius: 12px 12px 0 0;
    display: block;
    background-color: #ffffff;
    transition: transform 0.3s ease;
}
.category-card:hover .category-card-img {
    transform: scale(1.05);
}
.product-card-img {
    width: 100%;
    height: 280px;
    object-fit: contain !important;
    object-position: center;
    border-radius: 10px 10px 0 0;
    display: block;
    background-color: #ffffff;
    transition: transform 0.3s ease;
}
.product-card:hover .product-card-img {
    transform: scale(1.03);
}
.product-detail-main-img {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    display: block;
    background-color: #ffffff;
}
.related-product-img {
    width: 100%;
    height: 200px;
    object-fit: contain !important;
    object-position: center;
    border-radius: 8px;
    display: block;
    background-color: #ffffff;
}
.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain !important;
    object-position: center;
    border-radius: 8px;
    display: block;
    background-color: #ffffff;
}

/* ============================================
   RESPONSIVE IMÁGENES
   ============================================ */
@media (max-width: 768px) {
    .category-card-img { height: 200px; }
    .product-card-img { height: 220px; }
    .product-detail-main-img { max-height: 400px; }
}
@media (max-width: 576px) {
    .category-card-img { height: 160px; }
    .product-card-img { height: 180px; }
    .cart-item-img { width: 60px; height: 60px; }
}

/* ============================================
   LOGO
   ============================================ */
.navbar-brand img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}
footer img {
    max-height: 30px;
    width: auto;
    object-fit: contain;
}

/* ============================================
   FIX LAYOUT - CARDS DE PRODUCTOS
   ============================================ */

/* Imágenes en cards */
.product-card-img,
.product-img,
.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: contain !important;
    object-position: center;
    background-color: #ffffff;
}

/* Imagen en detalle */
.card-img-top[style*="max-height: 450px"] {
    height: 400px;
    object-fit: contain !important;
}

/* Imagen en relacionados */
.product-card .overflow-hidden[style*="height: 150px"] .product-img,
.product-card .overflow-hidden[style*="height: 150px"] .card-img-top {
    height: 150px;
    object-fit: contain !important;
}

/* Cards altura uniforme */
.product-card,
.card.h-100 {
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

/* Título máximo 2 líneas */
.card-title.text-truncate {
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
    line-height: 1.3;
    margin-bottom: 8px;
}

/* Descripción máximo 2 líneas - SIN style inline */
.card-body .card-text,
.card-body p.text-muted.small,
.card-text.text-muted.small {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: auto !important;
    min-height: 2.8em;
    max-height: 2.8em;
    margin-bottom: 10px !important;
    flex-shrink: 0;
    line-height: 1.4;
}

/* Precio siempre abajo */
.mt-auto .h5,
.mt-auto .h4,
.mt-auto .text-primary {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #eee;
    margin-bottom: 12px;
}

/* Botones siempre al final */
.card-body .d-grid,
.card-body .mt-auto .d-grid {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
}
.card-body .btn {
    width: 100%;
}
.mt-auto .d-grid,
.mt-auto .d-grid.gap-2 {
    margin-top: 0;
}

/* Categorías imagen */
.category-card-img {
    width: 100%;
    height: 160px;
    object-fit: contain !important;
    object-position: center;
    background-color: #ffffff;
}

/* ============================================
   RESPONSIVE CELULARES
   ============================================ */
@media (max-width: 768px) {
    .product-card-img,
    .product-img,
    .card-img-top {
        height: 160px;
    }
    .product-card,
    .card.h-100 {
        min-height: 380px;
    }
    .category-card-img {
        height: 120px;
    }
}

/* Logo redondeado en navbar */
.navbar-brand img {
    border-radius: 50% !important;
    object-fit: cover;
}