:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --secondary: #2c3e50;
    --bg-light: #fdfaf5;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --card-bg: #ffffff;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header */
.header {
    background: #fff;
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.home-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.header-center {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

#search-bar {
    width: 100%;
    padding: 10px 15px 10px 45px;
    border-radius: 25px;
    border: 1px solid #ddd;
    outline: none;
    transition: 0.3s;
}

#search-bar:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right a {
    text-decoration: none;
    color: var(--secondary);
    font-size: 1.2rem;
    position: relative;
}

/* Sidebar */
.sidebar {
    background: var(--secondary);
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    width: 280px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding-top: 60px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.sidebar.open {
    left: 0;
}

.nav-link {
    display: block;
    color: #ecf0f1;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 35px;
}

/* Grid & Content */
.content {
    padding: 40px 5%;
    max-width: 1300px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1;
    background: #fff;
    position: relative;
    border-bottom: 1px solid #f5f5f5;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.5s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Auth Pages (Login) */
.auth-page {
    background: linear-gradient(135deg, #fdfaf5 0%, #f3e5d8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    box-shadow: 0 8px 15px rgba(230, 126, 34, 0.2);
}

.auth-header h1 {
    font-size: 1.6rem;
    margin: 0 0 10px;
    color: var(--secondary);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .input-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}

.auth-form .input-field input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    transition: 0.3s;
}

.auth-form .input-field input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

.auth-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.auth-footer {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-message.error { color: #e74c3c; }
.auth-message.success { color: #27ae60; }

/* Product Detail Page */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 15px;
        overflow-x: hidden;
    }
    .header-center { display: none; }
}

.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    min-width: 0;
}

.main-image-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.main-image-container img, .main-image-container video, .main-image-container iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0 15px 0;
    width: 100%;
    max-width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-image {
    flex: 0 0 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumbnail-image.active {
    border-color: var(--primary);
}

.thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-detail-name {
    font-size: 2rem;
    margin: 0 0 15px 0;
    color: var(--secondary);
}

.price-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* Buttons */
.btn-card, .buy-button, .add-to-cart-button, #watch-video-button, .mercado-libre-button, .download-demo-button, #share-product-button {
    padding: 12px 25px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    display: inline-block;
}

.btn-primary-card, .buy-button {
    background: var(--primary);
    color: #fff;
}

.btn-primary-card:hover, .buy-button:hover {
    background: var(--primary-dark);
}

#share-product-button {
    background: #f1f1f1;
    color: #333;
}

.add-to-cart-button {
    background: var(--secondary);
    color: white;
}

.add-to-cart-button:hover {
    background: #34495e;
}

.mercado-libre-button {
    background: #fff159;
    color: #333;
    width: 100%;
}

.mercado-libre-button:hover {
    filter: brightness(0.95);
}

#watch-video-button {
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

#watch-video-button:hover {
    background: #e74c3c;
    color: white;
}

.download-demo-button {
    background: #27ae60;
    color: white;
}

/* Badges */
.badge-web {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    z-index: 2;
}
.badge-video { background: #e74c3c; }
.badge-shipping { background: #27ae60; top: 45px; }

/* Reviews */
#reviews-section {
    margin-top: 50px;
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.review-card {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.review-card:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-name {
    font-weight: 700;
    color: var(--secondary);
}

.review-rating {
    color: #f1c40f;
}

#review-form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#review-form input, #review-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

#review-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    font-size: 1.5rem;
    gap: 5px;
}

.rating-input span {
    cursor: pointer;
    color: #e4e5e9;
    transition: 0.2s;
}

.rating-input span:hover,
.rating-input span:hover ~ span {
    color: #ffc107;
}

/* Footer */
.site-footer {
    background: var(--secondary);
    color: #bdc3c7;
    padding: 40px 5%;
    text-align: center;
    margin-top: 50px;
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Video Modal */
.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.video-modal-content {
    width: 90%;
    max-width: 800px;
    aspect-ratio: 16/9;
    position: relative;
}

.video-modal-content iframe {
    width: 100%;
    height: 100%;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 2.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

.whatsapp-float i {
    line-height: 1;
}

/* --- REGLAS DE VIDEO EN GALERÍA --- */
.video-thumb i {
    font-size: 1.5rem;
    color: var(--primary);
}

.video-thumb::after {
    content: 'PLAY';
    position: absolute;
    bottom: 5px;
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--primary);
}

.brand-name:empty::before {
    content: '\00a0';
}

/* --- FLECHAS DEL CARRUSEL --- */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--secondary);
    transition: 0.3s;
}

.nav-arrow:hover { background: var(--primary); color: white; }
.nav-arrow.left { left: 15px; }
.nav-arrow.right { right: 15px; }

/* --- NUEVAS REGLAS DE FILTROS --- */
#category-title-container { padding: 10px 0; border-bottom: 2px solid var(--primary); margin-bottom: 20px; }
#clear-filter { background: var(--primary); color: white; border: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
