/* Variables Premium */
:root {
    --bg-color: #f9f9f9;
    --text-main: #111111;
    --text-muted: #555555;
    --primary: #000000; /* Fondo negro puro as requested */
    --primary-hover: #222222;
    --accent: #d4af37; /* Metallic Gold for a premium feel */
    --accent-hover: #b59228;
    --amazon-orange: #f0c14b; /* Subtle nod to Amazon Buttons */
    --prime-blue: #00a8e1;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.header {
    background-color: var(--primary);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Empuja el contenido hacia la izquierda centrada */
    padding: 0 8%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 60px; /* Distancia entre logo y buscador */
    height: 80px; /* Restauramos la altura pequeña del fondo negro */
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.85;
}

.brand-logo {
    height: 64px; /* Tamaño máximo adaptado para no modificar la franja negra de 80px */
    width: auto;
}

.search-bar {
    flex: 1;
    display: flex;
    background-color: var(--white);
    border-radius: 4px;
    overflow: hidden;
    max-width: 800px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.search-btn {
    background-color: var(--accent);
    color: var(--primary);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: var(--accent-hover);
}

.user-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.action-btn {
    color: var(--white);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-count {
    background-color: var(--accent);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-categories {
    background-color: #232f3e; /* Amazon-like secondary dark */
    padding: 8px 24px;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-categories::-webkit-scrollbar {
    display: none;
}

.nav-category {
    color: #cccccc;
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-category:hover, .nav-category.active {
    color: var(--white);
    font-weight: 500;
}

/* Hero Section */
.hero {
    height: 60vh;
    min-height: 400px;
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1616486338812-3dadae4b4ace?auto=format&fit=crop&q=80&w=1920') center/cover;
    display: flex;
    align-items: center;
    padding: 0 5%;
    color: var(--white);
}

.hero-content {
    max-width: 600px;
    animation: fadeUp 0.8s ease-out;
}

.hero-badge {
    background-color: var(--accent);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.2rem;
    color: #eeeeee;
    margin-bottom: 32px;
}

.primary-btn {
    background-color: var(--white);
    color: var(--primary);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
}

.primary-btn:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Products Section */
.products-section {
    max-width: 1400px;
    margin: 48px auto;
    padding: 0 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--white);
    cursor: pointer;
    outline: none;
}

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

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

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

.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: #fff;
    overflow: hidden;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stars {
    color: var(--amazon-orange);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto; /* Pushes price to bottom if title is short */
    display: flex;
    align-items: flex-start;
}

.currency {
    font-size: 0.9rem;
    margin-top: 4px;
    margin-right: 2px;
}

.prime-badge {
    color: var(--prime-blue);
    font-weight: 700;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--radius);
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 2rem;
    color: var(--text-muted);
    transition: color 0.2s;
    z-index: 10;
}

.close-modal:hover {
    color: var(--primary);
}

/* Modal Amazon Listing Style Layout */
.listing-layout {
    display: grid;
    grid-template-columns: 40% 60%;
    padding: 40px;
    gap: 40px;
}

.listing-image-col {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.listing-image-col img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.listing-details-col {
    display: flex;
    flex-direction: column;
}

.listing-title {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}

.listing-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--prime-blue);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.listing-price-block {
    margin-bottom: 24px;
}

.listing-price {
    font-size: 2rem;
    font-weight: 500;
    color: #B12704; /* Amazon-like price red/brown */
}

.listing-description {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 24px;
}

.listing-bullets {
    margin-left: 20px;
    margin-bottom: 32px;
}

.listing-bullets li {
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.5;
}

.listing-actions {
    display: flex;
    gap: 16px;
    margin-top: auto;
}

.btn-add-cart, .btn-buy-now {
    flex: 1;
    padding: 14px;
    border-radius: 20px; /* Pill shape like Amazon */
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-add-cart {
    background-color: var(--amazon-orange);
    color: var(--primary);
}

.btn-add-cart:hover {
    background-color: #dfb342;
}

.btn-buy-now {
    background-color: #ffa41c;
    color: var(--primary);
}

.btn-buy-now:hover {
    background-color: #fa9705;
}

/* =========================================
   CONTACT SECTION
========================================= */
.contact-section {
    padding: 60px 8%;
    background-color: #f7f9fa; /* Fondo muy suave y premium para resaltar el formulario */
    margin-top: 40px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Sombra muy sutil */
}

.contact-header {
    text-align: center;
    margin-bottom: 30px;
}

.contact-header h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.contact-header p {
    color: var(--text-light);
    line-height: 1.6;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
}

.submit-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #222;
}

.submit-btn:active {
    transform: scale(0.98);
}

/* =========================================
   FOOTER
========================================= */
.footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding-top: 48px;
    margin-top: 64px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 48px;
}

.footer-col h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-col h4 {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-col p {
    color: #aaaaaa;
}

.footer-col a {
    display: block;
    color: #aaaaaa;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-bottom {
    background-color: #111111;
    text-align: center;
    padding: 24px;
    color: #888888;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .listing-layout {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-wrap: wrap;
    }
    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .listing-actions {
        flex-direction: column;
    }
}
