/* ============================================
   WORK SAFETY SHOP - Estilos Principales
   ============================================ */

/* Variables de color terracota */
:root {
    --primary-color: #E07856;
    --primary-dark: #C85A3A;
    --primary-light: #FF8C42;
    --secondary-color: #2C3E50;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --success: #28a745;
    --error: #dc3545;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-light);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */

header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.9rem;
    text-align: center;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-icon {
    position: relative;
    font-size: 1.3rem;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-icon:hover {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    display: none;
}

/* ============================================
   BÚSQUEDA Y FILTROS
   ============================================ */

.search-section {
    background-color: var(--white);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.results-count {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   GRID DE PRODUCTOS
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

#products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: var(--bg-light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.btn-wishlist:hover {
    transform: scale(1.1);
}

.btn-wishlist i {
    color: var(--text-light);
    transition: color 0.3s;
}

.btn-wishlist.active i {
    color: var(--error);
}

.product-info {
    padding: 1rem;
}

.product-category {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
}

.product-name {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: var(--text-color);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.product-rating i {
    color: #FFA500;
    font-size: 0.9rem;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.btn-add-cart {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-cart:hover {
    background-color: var(--primary-dark);
}

/* ============================================
   LOADER
   ============================================ */

#loader {
    display: none;
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================
   NOTIFICACIONES
   ============================================ */

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

.notification i {
    font-size: 1.3rem;
}

.notification-success i {
    color: var(--success);
}

.notification-info i {
    color: var(--primary-color);
}

/* ============================================
   MENSAJES DE ERROR Y VACÍO
   ============================================ */

.no-products,
.error-message,
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.no-products i,
.error-message i,
.empty-cart i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.no-products h2,
.empty-cart h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.no-products p,
.empty-cart p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* ============================================
   BOTONES GENERALES
   ============================================ */

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    transition: background-color 0.3s;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    #products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .product-name {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .btn-add-cart {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    #products-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        right: 10px;
        left: 10px;
    }
}
