:root {
    /* Variables Generales */
    --primary: #25d366;    /* Verde WhatsApp */
    --secondary: #128c7e;
    --dark: #1a1a1a;
    --light: #f4f7f6;
    --white: #ffffff;
    --grey: #888;
    --danger: #e74c3c;
    --accent: #3498db;     /* Azul Admin */
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, sans-serif; }

body { background-color: var(--light); color: var(--dark); line-height: 1.6; }

a { text-decoration: none; color: inherit; }

/* --- HEADER & NAV --- */
header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

header h1 { font-size: 1.5rem; letter-spacing: -1px; }

.cart-icon {
    background: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}
.cart-icon:hover { transform: scale(1.05); }

/* --- CONTENEDORES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-container { max-width: 1000px; margin: 30px auto; padding: 20px; }

/* --- CATALOGO (Clientes) --- */
#catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 5%;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover { transform: translateY(-5px); }

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 8px;
}

.precios { background: #f9f9f9; padding: 10px; border-radius: 8px; margin: 10px 0; }
small { color: var(--primary); font-weight: bold; display: block; margin-top: 5px; }

/* --- BOTONES --- */
button, .btn-link {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: inline-block;
    text-align: center;
}

button { background: var(--dark); color: white; transition: background 0.2s; }
button:hover { background: #333; }

.btn-whatsapp { background: var(--primary); color: white; }
.btn-whatsapp:hover { background: #1eb956; }

.btn-add { background: var(--accent); color: white; width: auto; padding: 10px 20px; text-decoration: none; }
.btn-vaciar { background: var(--danger); margin-top: 20px; }

/* --- ADMIN & FORMULARIOS --- */
.form-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }

input[type="text"], input[type="number"], select, textarea, input[type="password"], input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

/* Secciones condicionales */
.section-electronica { border-left: 5px solid var(--accent); padding-left: 15px; background: #fbfbfb; padding: 15px; }
.section-fundas { border-left: 5px solid #9b59b6; padding-left: 15px; background: #fbfbfb; padding: 15px; }

/* --- TABLAS (Admin & Matriz) --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; background: white; border-radius: 8px; overflow: hidden; }
th { background: var(--dark); color: white; padding: 12px; text-align: left; }
td { padding: 12px; border-bottom: 1px solid #eee; }
tr:hover { background: #f1f1f1; }

.admin-thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.badge { padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; color: white; }
.badge-electronica { background: var(--accent); }
.badge-fundas { background: #9b59b6; }

/* --- MODAL --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
}
.hidden { display: none !important; }
.modal-content { background: white; padding: 20px; border-radius: var(--radius); max-width: 90%; max-height: 90%; overflow-y: auto; }
.close { float: right; font-size: 28px; cursor: pointer; }
.btn-small { width: auto; padding: 5px 10px; font-size: 0.8rem; }