/* === AMAZON-STYLE CATEGORY PAGES === */
/* Sistema de diseño unificado inspirado en Amazon con acentos gaming */

/* === VARIABLES GLOBALES === */
:root {
    /* Colores de fondo */
    --bg-page: #e3e6e6;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-header: #131921;
    --bg-header-secondary: #232f3e;
    --bg-gray-light: #f7f7f7;
    --bg-gray: #f0f2f2;
    
    /* Colores de acento */
    --accent-primary: #00ff41;
    --accent-primary-dark: #00cc33;
    --accent-orange: #ff9900;
    --accent-deal: #cc0c39;
    
    /* Colores de texto */
    --text-dark: #0f1111;
    --text-secondary: #565959;
    --text-muted: #888888;
    --text-link: #007185;
    --text-link-hover: #c7511f;
    --text-white: #ffffff;
    --text-price: #b12704;
    
    /* Bordes y sombras */
    --border-light: #ddd;
    --border-medium: #d5d9d9;
    --shadow-card: 0 2px 5px rgba(0,0,0,0.1);
    --shadow-card-hover: 0 4px 15px rgba(0,0,0,0.15);
    
    /* Layout */
    --max-width: 1500px;
    --header-height: 60px;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Amazon Ember', 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* === SKIP LINK === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: var(--text-dark);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* === HEADER PRINCIPAL === */
.header {
    background: linear-gradient(to bottom, var(--bg-header) 0%, var(--bg-header-secondary) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-primary);
}

.header .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo a:hover {
    border-bottom: 2px solid var(--accent-primary);
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 600px;
    display: flex;
}

.header-search input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
}

.header-search input:focus {
    box-shadow: 0 0 0 3px var(--accent-primary);
}

.header-search button {
    background: var(--accent-primary);
    border: none;
    padding: 0 1.25rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.header-search button:hover {
    background: var(--accent-primary-dark);
}

.header-search button i {
    color: var(--text-dark);
    font-size: 1.1rem;
}

/* Header Nav */
.header-nav {
    display: flex;
    gap: 0.5rem;
}

.header-nav a {
    color: var(--text-white);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 0.2s;
}

.header-nav a:hover {
    border-color: var(--text-white);
}

/* Language Switcher */
.header-nav .language-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.header-nav .language-switcher a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    background: transparent;
}

.header-nav .language-switcher a .flag {
    font-size: 1.1rem;
}

.header-nav .language-switcher a.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

.header-nav .language-switcher a:not(.active) {
    color: var(--text-white);
    opacity: 0.8;
}

.header-nav .language-switcher a:not(.active):hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* === SUB NAVIGATION === */
.sub-nav {
    background: var(--bg-header-secondary);
    padding: 0.5rem 0;
}

.sub-nav .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow-x: auto;
}

.sub-nav a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 0.25rem 0;
}

.sub-nav a:hover {
    text-decoration: underline;
}

.sub-nav a.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

/* === BREADCRUMB === */
.breadcrumb-nav {
    background: var(--bg-card);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb-nav .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    font-size: 0.85rem;
}

.breadcrumb-home {
    color: var(--text-link);
    text-decoration: none;
}

.breadcrumb-home:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: var(--text-secondary);
}

/* === PAGE HEADER === */
.page-header {
    background: var(--bg-card);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.page-header .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0;
}

/* === SEARCH SECTION === */
.search-section {
    background: var(--bg-card);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.search-section .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.search-container {
    max-width: 600px;
}

.search-input-wrapper {
    display: flex;
    border: 2px solid #bbb;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.2);
}

.search-icon {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    background: #f3f3f3;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-button {
    background: var(--accent-primary);
    border: none;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-button:hover {
    background: var(--accent-primary-dark);
}

.search-button i {
    color: #000;
}

.search-suggestions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tag {
    background: var(--bg-gray);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-tag:hover {
    background: #d5d9d9;
}

/* === MAIN CONTENT === */
.main-content {
    min-height: calc(100vh - var(--header-height));
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* === CATEGORIES SECTION === */
.categories {
    padding: 1.5rem 0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* === CATEGORY CARDS GRID === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.category-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.category-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.category-image {
    height: 180px;
    overflow: hidden;
    background: var(--bg-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.category-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.03);
    pointer-events: none;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.category-count {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-link);
    font-weight: 500;
}

.category-card:hover .category-count {
    color: var(--text-link-hover);
}

/* === ARTICLES SECTION === */
.articles-section {
    padding: 1.5rem 0 2rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* === ARTICLE CARDS === */
.article-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.article-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.article-image {
    height: 160px;
    overflow: hidden;
    background: var(--bg-gray-light);
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card:hover .article-title {
    color: var(--text-link-hover);
}

.article-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.75rem 0;
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.article-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--text-link);
    font-size: 0.85rem;
    text-decoration: none;
}

.article-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* === PRODUCT CARDS === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
    border: 1px solid var(--border-light);
}

.product-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.product-image {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    background: var(--bg-gray-light);
    border-radius: 4px;
    padding: 0.5rem;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.product-title {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card:hover .product-title {
    color: var(--text-link-hover);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.product-rating .stars {
    color: #ffa41c;
    font-size: 0.85rem;
}

.product-rating .count {
    font-size: 0.75rem;
    color: var(--text-link);
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-price);
}

.product-price .currency {
    font-size: 0.8rem;
    vertical-align: top;
}

/* === FOOTER === */
.footer {
    background: linear-gradient(to bottom, var(--bg-header) 0%, #0a0d10 100%);
    color: var(--text-white);
    padding: 3rem 0 0;
    margin-top: 2rem;
}

.footer .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text-white);
    margin: 0 0 0.75rem 0;
}

.footer-brand a {
    text-decoration: none;
    color: inherit;
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--accent-primary);
    color: var(--text-dark);
    transform: translateY(-3px);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin: 0 0 0.25rem 0;
}

.footer-bottom strong {
    color: var(--accent-primary);
}

/* Footer Responsive */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-brand {
        text-align: center;
    }
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .categories-grid,
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .categories-grid,
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header .container {
        flex-wrap: wrap;
    }
    
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .header-nav {
        display: none;
    }
    
    /* Mostrar solo el language switcher en móvil */
    .header-nav .language-switcher {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        padding: 0;
        border: none;
    }
}

@media (max-width: 600px) {
    .categories-grid,
    .articles-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .sub-nav .container {
        gap: 1rem;
    }
}

/* === MATRIX RAIN (opcional) === */
.matrix-rain {
    display: none;
}

/* === UTILITY CLASSES === */
.matrix-text {
    color: inherit;
}

.gaming-badge {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%);
    color: #000;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.75rem;
}

.deal-badge {
    background: var(--accent-deal);
    color: #fff;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.75rem;
}

/* === ARTICLES CONTAINER (Subcategorías) === */
.articles-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.5rem 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* === CARD STYLES (Subcategorías) === */
.article-card,
.article-card .card-link {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.article-card .card-link {
    border: none;
    height: 100%;
}

.article-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card-image {
    height: 180px;
    overflow: hidden;
    background: var(--bg-gray-light);
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card:hover .card-title {
    color: var(--text-link-hover);
}

.card-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.75rem 0;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.card-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-read {
    color: var(--text-link);
    font-weight: 500;
}

.article-card:hover .card-read {
    color: var(--text-link-hover);
}

/* Responsive para articles-container */
@media (max-width: 1200px) {
    .articles-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .articles-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .articles-container {
        grid-template-columns: 1fr;
    }
}
