:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --gray: #f4f4f4;
    --accent: #ff4d00;
    --red: #e74c3c;
    --green: #25D366;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #fafafa;
    background-image: radial-gradient(#eee 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--black);
    line-height: 1.6;
}

header { padding: 15px 5%; position: sticky; top: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid var(--gray); }
nav { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 45px; cursor: pointer; vertical-align: middle; }
.menu button { background: none; border: none; margin-left: 15px; font-weight: 600; cursor: pointer; text-transform: uppercase; font-size: 12px; transition: 0.2s; }
.menu button:hover { opacity: 0.7; }

/* Banner */
.hero-banner {
    background: linear-gradient(135deg, #0a0a0a 0%, #2a2a2a 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin: 0 5% 30px 5%;
    border-radius: 20px;
}
.hero-banner h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
}
.hero-banner p {
    font-weight: 300;
    opacity: 0.8;
}

/* Búsqueda */
.search-bar-container {
    max-width: 600px;
    margin: 0 auto 30px auto;
}
.search-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #eee;
    border-radius: 50px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: 0.3s;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.search-input:focus {
    border-color: var(--black);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Filtros */
.filtros-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}
.cat-pill {
    background: #f0f0f0;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    text-transform: capitalize;
}
.cat-pill.active {
    background: var(--black);
    color: white;
}

/* Paneles y grid */
.panel { display: none; padding: 40px 5%; animation: fadeIn 0.4s ease; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-title { text-align: center; font-family: 'Syne', sans-serif; font-size: 32px; margin-bottom: 40px; text-transform: uppercase; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.product-card { cursor: pointer; transition: 0.3s; border-radius: 12px; overflow: hidden; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 350px; object-fit: cover; background: var(--gray); }
.product-info { padding: 20px; text-align: center; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 2px solid var(--black); padding-bottom: 15px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 40px; }
.admin-card { background: var(--gray); padding: 30px; border-radius: 15px; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; }
.file-drop-area { display: block; padding: 30px; border: 2px dashed #bbb; border-radius: 8px; text-align: center; cursor: pointer; margin-bottom: 15px; background: white; transition: 0.3s; }
.file-drop-area:hover { border-color: var(--black); background: #fafafa; }

.inventory-item { display: flex; align-items: center; justify-content: space-between; background: white; padding: 15px; margin-bottom: 12px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.inventory-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }

/* Botones */
.btn-primary { background: var(--black); color: white; padding: 15px 30px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; width: 100%; transition: 0.3s; }
.btn-primary:hover { opacity: 0.9; transform: scale(0.98); }
.btn-secondary { background: #f0f0f0; color: var(--black); padding: 15px 30px; border: 1px solid #ddd; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.btn-secondary:hover { background: #e0e0e0; }
.wsp-bg { background: var(--green); }
.btn-outline { background: none; border: 1px solid var(--black); padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.btn-outline:hover { background: var(--black); color: white; }
.btn-cancel { margin-top: 10px; background: none; border: none; cursor: pointer; color: #666; width: 100%; }

/* Modales */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: white; width: 100%; max-width: 480px; max-height: 90vh; border-radius: 24px; overflow-y: auto; position: relative; animation: modalFadeIn 0.3s ease; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.modal::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }

.close-modal { position: sticky; top: 10px; right: 15px; float: right; font-size: 28px; font-weight: bold; border: none; background: white; cursor: pointer; z-index: 10; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 10px 10px 0 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1); color: #333; transition: 0.2s; }
.close-modal:hover { background: #f0f0f0; transform: scale(1.05); }

.modal-img-container { width: 100%; background: #f5f5f5; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-img { width: 100%; max-width: 280px; height: auto; object-fit: cover; border-radius: 16px; }
.modal-content { padding: 0 24px 24px 24px; }
.modal-categoria { background: var(--black); color: white; padding: 4px 12px; border-radius: 20px; font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; display: inline-block; margin-bottom: 12px; }
.modal-content h2 { font-size: 22px; margin-bottom: 6px; font-family: 'Syne', sans-serif; }
.modal-price { font-size: 20px; font-weight: 700; color: var(--black); margin-bottom: 12px; }
.modal-desc { font-size: 14px; color: #666; line-height: 1.5; margin-bottom: 20px; }

.selector-section { background: #f8f8f8; padding: 14px; border-radius: 16px; margin-bottom: 16px; }
.selector-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; color: #333; display: block; }
.selected-value { font-size: 12px; color: #888; margin-top: 10px; text-align: center; font-weight: 500; }

.color-options { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.color-circle { width: 48px; height: 48px; border-radius: 50%; cursor: pointer; border: 2px solid #ddd; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.color-circle:hover:not(.sin-stock) { transform: scale(1.08); border-color: #000; box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.color-circle.selected { border: 3px solid #000; transform: scale(1.12); box-shadow: 0 0 0 2px white, 0 0 0 4px #000; }
.color-circle[style*="background-color: #F0F0F0"], .color-circle[style*="background-color: #f0f0f0"] { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.06) 0px, rgba(0,0,0,0.06) 2px, transparent 2px, transparent 8px) !important; border: 2px solid #999; }

.talla-options { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.talla-btn { min-width: 56px; height: 48px; border: 2px solid #e0e0e0; background: white; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all 0.2s; padding: 0 14px; }
.talla-btn:hover:not(.sin-stock) { border-color: var(--black); background: #fafafa; transform: translateY(-1px); }
.talla-btn.selected { background: var(--black); color: white; border-color: var(--black); }
.talla-btn.sin-stock { color: #bbb; border-color: #eee; cursor: not-allowed; text-decoration: line-through; }

.cantidad-control { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 10px 0; }
.cantidad-btn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #e0e0e0; background: white; font-size: 22px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.cantidad-btn:hover { background: var(--black); color: white; border-color: var(--black); }
.cantidad-numero { font-size: 26px; font-weight: 800; min-width: 50px; text-align: center; }
.stock-info { font-size: 12px; color: #888; text-align: center; margin-top: 8px; }

.stock-warning { background: #fff3cd; border: 1px solid #ffc107; padding: 10px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; color: #856404; text-align: center; }

.modal-small { background: white; width: 100%; max-width: 340px; border-radius: 28px; overflow: hidden; text-align: center; animation: modalFadeIn 0.3s ease; }
.modal-small-content { padding: 32px 24px; }
.success-icon { font-size: 56px; margin-bottom: 16px; }
.modal-small-content h3 { font-size: 22px; margin-bottom: 12px; font-family: 'Syne', sans-serif; }
.modal-small-content p { color: #666; margin-bottom: 24px; font-size: 14px; }
.confirm-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.confirm-buttons button { flex: 1; padding: 12px; border-radius: 40px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 14px; }

.cart-items { max-height: 400px; overflow-y: auto; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--black); color: white; padding: 12px 30px; border-radius: 50px; z-index: 5000; transition: 0.4s; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 550px) {
    .modal-overlay { padding: 12px; }
    .modal { max-width: 100%; border-radius: 20px; }
    .modal-content { padding: 0 18px 20px 18px; }
    .modal-content h2 { font-size: 18px; }
    .modal-price { font-size: 18px; }
    .color-circle { width: 42px; height: 42px; }
    .talla-btn { min-width: 48px; height: 42px; font-size: 13px; padding: 0 10px; }
    .cantidad-btn { width: 40px; height: 40px; font-size: 20px; }
    .cantidad-numero { font-size: 22px; }
    .confirm-buttons { flex-direction: column; }
    .confirm-buttons button { width: 100%; }
    .admin-grid { grid-template-columns: 1fr; }

    /* MEJORAS MÓVIL */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px;
        padding: 0 10px;
    }
    .product-card img { 
        height: 180px; 
    }
    .product-info { 
        padding: 10px; 
    }
    .product-info h3 { 
        font-size: 12px; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }
    .product-info p { 
        font-size: 13px; 
        font-weight: 700; 
    }
    .filtros-categorias { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        justify-content: flex-start; 
        padding: 0 10px 8px 10px;
        -webkit-overflow-scrolling: touch;
    }
    .filtros-categorias::-webkit-scrollbar { display: none; }
    .cat-pill { 
        white-space: nowrap; 
        flex-shrink: 0; 
    }
    .hero-banner { 
        margin: 0 0 20px 0; 
        border-radius: 0; 
        padding: 30px 15px; 
    }
    .hero-banner h1 { font-size: 1.4rem; }
    .section-title { font-size: 22px; margin-bottom: 20px; }
    .panel { padding: 20px 3%; }
}

@media (min-width: 551px) and (max-width: 768px) {
    .modal { max-width: 520px; }
    .color-circle { width: 52px; height: 52px; }
}
