/* VARIABLES DE COLOR Y FUENTES */
:root {
    --color-primary: #007bff; /* Azul vibrante para botones principales */
    --color-secondary: #6c757d; /* Gris para textos secundarios */
    --color-dark: #343a40; /* Negro/Gris oscuro para texto y header */
    --color-light: #f8f9fa; /* Gris muy claro para fondos */
    --color-white: #ffffff;
    --color-success: #28a745; /* Verde para éxito/añadido al carrito */
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
}

/* ----------------------------- ESTILOS GLOBALES ----------------------------- */
body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--color-white);
    color: var(--color-dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4 {
    color: var(--color-dark);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--color-primary);
}

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
}

.btn-primary:hover {
    background-color: #0056b3; /* Tono más oscuro al pasar el ratón */
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
    text-decoration: none;
}

.bg-light-gray {
    background-color: var(--color-light);
    padding: var(--spacing-lg) 0;
}

/* ----------------------------- HEADER Y NAVEGACIÓN ----------------------------- */
.main-header {
    background-color: var(--color-white);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--color-dark);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav li {
    margin: 0 1rem;
}

.main-nav a {
    color: var(--color-dark);
    font-weight: 500;
    padding: 0.5rem;
    text-transform: uppercase;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    text-decoration: none;
}

.header-actions .cart-icon {
    font-size: 1.1rem;
    padding: 0.5rem;
    color: var(--color-dark);
}

/* ----------------------------- SECCIONES DE CONTENIDO ----------------------------- */
section {
    padding: var(--spacing-lg) 0;
}

/* A. HERO SECTION */
.hero-section {
    background: var(--color-dark);
    color: var(--color-white);
    text-align: center;
    padding: 6rem 0;
}

.hero-section h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* B. CATEGORIES SECTION */
.categories-section h3 {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.category-card {
    display: block;
    text-align: center;
    padding: var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: var(--color-white);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-decoration: none;
}

/* C. FEATURED PRODUCTS */
.featured-products-section h3 {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    background-color: var(--color-white);
}

.product-card h4 {
    margin: 0.5rem 0;
}

.price-old {
    color: var(--color-secondary);
    text-decoration: line-through;
    margin-bottom: 0;
}

.price-new {
    color: #dc3545; /* Rojo para ofertas */
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
}

.text-center {
    text-align: center;
}

/* D. REVIEWS SECTION */
.reviews-section h3 {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.review-item {
    background-color: var(--color-white);
    padding: var(--spacing-md);
    margin: 1rem 0;
    border-left: 5px solid var(--color-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 0.25rem;
}

.reviewer-name {
    font-weight: 600;
    text-align: right;
    display: block;
}

/* E. APP DOWNLOAD SECTION */
.app-download-section {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-lg) 0;
}

.app-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.app-content h3 {
    color: var(--color-white);
    font-size: 2rem;
}

.app-content ul {
    list-style: none;
    padding: 0;
}

.app-content li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.app-visuals {
    max-width: 300px;
    text-align: center;
    /* Esto simula la parte visual, necesitas agregar las imágenes */
}

/* ----------------------------- FOOTER ----------------------------- */
.main-footer {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: var(--spacing-lg) 0 1rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #495057;
}

.footer-grid h4 {
    color: var(--color-white);
    margin-bottom: 1rem;
}

.footer-grid a {
    color: var(--color-light);
    display: block;
    margin-bottom: 0.5rem;
}

.copyright {
    text-align: center;
    padding-top: 1rem;
    font-size: 0.9rem;
}

/* ----------------------------- MEDIA QUERIES (RESPONSIVE) ----------------------------- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin: 1rem 0;
    }

    .main-nav li {
        margin: 0.5rem;
    }

    .app-content {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}



/* ---------------------------------CATALOGO----------------------------------------- */



/* EXTENSIONES PARA styles.css */

/* Estilo del Main de Catálogo */
.catalogo-layout {
    display: flex;
    gap: 2rem;
    padding-top: var(--spacing-lg);
}

/* ----------------------------- BARRA LATERAL (FILTROS) ----------------------------- */
.sidebar-filters {
    width: 280px; /* Ancho fijo para la barra lateral */
    flex-shrink: 0; /* Evita que se encoja */
    background-color: var(--color-light);
    padding: var(--spacing-md);
    border-radius: 0.5rem;
    height: fit-content; /* Se ajusta a la altura del contenido */
    position: sticky; /* Opcional: para que se quede fija al hacer scroll */
    top: 20px;
}

.sidebar-filters h3 {
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: var(--spacing-md);
}

.filter-group {
    margin-bottom: var(--spacing-md);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 400;
}

.apply-filters-btn {
    width: 100%;
    margin-top: 1rem;
}

/* ----------------------------- CONTENEDOR DE PRODUCTOS ----------------------------- */
.products-container {
    flex-grow: 1; /* Ocupa el espacio restante */
}

/* Barra de herramientas (ordenar y resultados) */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.products-toolbar .results-count {
    font-weight: 500;
    color: var(--color-secondary);
}

/* Rejilla de productos (igual que en la home, pero más densa) */
.products-container .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 3-4 columnas */
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-primary);
    margin: 0 0.2rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s;
}

.page-link:hover:not(.active):not(.disabled) {
    background-color: var(--color-light);
    text-decoration: none;
}

.page-link.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
}

.page-link.disabled {
    color: var(--color-secondary);
    border-color: #ddd;
    pointer-events: none; /* No permite clics */
}

/* Media Query para móvil */
@media (max-width: 992px) {
    .catalogo-layout {
        flex-direction: column;
    }

    .sidebar-filters {
        width: 100%;
        position: static; /* Desactiva sticky en móvil */
    }
}


/* -----------------------------CONTACTO---------------------------------- */

/* Layout principal de dos columnas */
.contact-layout {
    display: flex;
    gap: 3rem;
    padding: var(--spacing-lg) 0;
}

.contact-info {
    flex: 1; /* Ocupa la mitad del espacio */
    padding-right: 2rem;
}

.contact-form-container {
    flex: 1; /* Ocupa la otra mitad */
    padding: 2rem;
    border-radius: 0.5rem;
}

.contact-form h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Estilos de los detalles de contacto */
.detail-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-item h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.detail-item .small-text {
    font-size: 0.9rem;
    color: var(--color-secondary);
}

.social-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Estilos del formulario */
.form-group {
    margin-bottom: 1rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    box-sizing: border-box; /* Asegura que el padding no cambie el ancho total */
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

/* Media Query para móvil */
@media (max-width: 768px) {
    .contact-layout {
        flex-direction: column;
    }
}

/*---------------------------------CARRITO----------------------------------------- */

.carrito-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start; /* Alinea arriba el contenido */
}

.cart-items-container {
    flex: 2; /* Ocupa más espacio (2/3) */
    background-color: var(--color-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.order-summary {
    flex: 1; /* Ocupa menos espacio (1/3) */
    background-color: var(--color-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky; /* Se mantiene al hacer scroll */
    top: 20px;
}

/* Estilo de cada ítem en el carrito */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-details {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.item-details h4 {
    margin: 0;
    font-size: 1.1rem;
}

.item-price {
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin: 0.2rem 0 0 1rem;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quantity-input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
}

.item-subtotal {
    font-weight: 600;
    width: 80px;
    text-align: right;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: 700;
}

.btn-remove:hover {
    color: var(--color-dark);
}

.back-to-shop {
    margin-top: 1.5rem;
    display: block;
}

/* Estilos del Resumen */
.order-summary h3 {
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.summary-line.total {
    font-size: 1.25rem;
    color: var(--color-primary);
    padding-top: 1rem;
    border-top: 1px dashed #ccc;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
}

/* Métodos de Pago */
.payment-methods {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--color-light);
    border-radius: 0.25rem;
}

.payment-methods h4 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.payment-methods label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Media Query para móvil */
@media (max-width: 992px) {
    .carrito-layout {
        flex-direction: column;
    }
    .order-summary {
        width: 100%;
        position: static;
    }
    .item-controls {
        gap: 0.5rem;
    }
}


/* REGLA para IMÁGENES DENTRO DE LAS CATEGORÍAS */
.category-card img {
    /* Define un tamaño fijo y pequeño, ya que es un icono */
    width: 80px; 
    height: 80px;
    
    /* Centra la imagen dentro de la tarjeta */
    margin: 0 auto 0.5rem; 
    display: block;
    
    /* Asegura que la imagen no se distorsione si el archivo es rectangular */
    object-fit: contain; 
}



/* --------------- elementos de producto en la vista de tieda ------------- */

/* ---  --- */

/* Estilos de Stock */
.stock-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.stock-available {
    background-color: #28a745; /* Verde */
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Estilo del Precio en Bolivianos (BS) */
.product-price-bs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary); /* Azul fuerte */
    margin: 0.5rem 0;
}

/* Contenedor de Botones y Controles */
.product-actions-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #eee;
}

/* Controles de Cantidad */
.quantity-controls-mini {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px; /* Borde más redondeado para los botones */
    overflow: hidden;
    flex-grow: 1;
}

.quantity-controls-mini button, .qty-input-mini {
    border: none;
    padding: 0.5rem;
    height: 40px;
}

.qty-input-mini {
    width: 30px;
    text-align: center;
    flex-grow: 1;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    /* Eliminar flechas de incremento/decremento en navegadores */
   
}
.qty-input-mini::-webkit-outer-spin-button,
.qty-input-mini::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-qty-minus, .btn-qty-plus {
    background: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--color-primary);
    width: 40px; /* Asegura un tamaño de círculo decente */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Botones Azules (Carrito) y Grises (Detalles) */
.btn-cart-mini {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 50%; /* Circular */
}

.btn-detail-mini {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    background-color: var(--color-light); /* Gris claro */
    color: var(--color-dark);
    border: 1px solid #ccc;
    border-radius: 50%; /* Circular */
}


/* --- -------------DETALLES DE PRODUCTO (producto-detalle.html) --------------- */

.product-detail-main {
    padding: var(--spacing-lg) 0;
}

.product-content-card {
    display: flex;
    background-color: var(--color-white);
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    gap: 3rem;
    align-items: flex-start;
}

/* Área de Imágenes */
.image-gallery-detail {
    flex: 1;
    max-width: 50%;
}

.main-product-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, border 0.3s;
}

.thumbnails img:hover {
    opacity: 1;
    border-color: var(--color-primary);
}

/* Área de Información */
.product-summary-detail {
    flex: 1;
    max-width: 50%;
}

.product-title-lg {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.product-status-price {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.price-bs-lg {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary); /* Azul */
    margin: 0.5rem 0 1.5rem 0;
}

.specs-title-lg, .description-title-lg {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.divider {
    border: none;
    border-top: 1px dashed #eee;
    margin: 1rem 0;
}

/* Controles de Compra Grandes */
.purchase-controls-lg {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Controles de Cantidad Grandes */
.quantity-controls-lg {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 25px; /* Más redondeado */
    overflow: hidden;
    height: 50px; /* Mayor altura */
}

.quantity-controls-lg button, .qty-input-lg {
    border: none;
    padding: 0.75rem;
    height: 50px;
    font-size: 1.1rem;
}

.qty-input-lg {
    width: 60px;
    text-align: center;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    -moz-appearance: textfield; 
}
.qty-input-lg::-webkit-outer-spin-button,
.qty-input-lg::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-qty-minus-lg, .btn-qty-plus-lg {
    width: 50px;
    background: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--color-primary);
}

.btn-cart-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px; /* Redondeado como el control de cantidad */
}

/* Media Query para móvil */
@media (max-width: 992px) {
    .product-content-card {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .image-gallery-detail, .product-summary-detail {
        max-width: 100%;
        width: 100%;
    }

    .purchase-controls-lg {
        flex-direction: column;
        align-items: stretch;
    }
    .quantity-controls-lg {
        width: 100%;
    }
    .btn-cart-lg {
        width: 100%;
    }
}