:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #f39c12;
    --bg-color: #f4f4f4;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-color: #dddddd;
    --border-soft: #eeeeee;
    --surface: #ffffff;
    --surface-soft: #f9f9f9;
    --surface-hover: #f0f0f0;
    --hint-bg: #eef6ff;
    --hint-border: #cfe4f7;
    --disabled-bg: #cccccc;
    --disabled-text: #777777;
    --add-btn-bg: #f39c12;
    --add-btn-hover: #d98200;
    --text-light: #ffffff;
    --whatsapp-green: #25d366;
    --shadow: rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ====== TEMA OSCURO (violeta) ====== */
html[data-theme="dark"] {
    --primary-color: #ffffff;
    --secondary-color: #1a1028;
    --bg-color: #120a20;
    --card-bg: #1a1028;
    --text-dark: #f0eafc;
    --text-secondary: #c4b8e0;
    --text-muted: #9b8fc0;
    --border-color: #4a3a70;
    --border-soft: #2e2148;
    --surface: #231744;
    --surface-soft: #150d26;
    --surface-hover: #2c1f52;
    --hint-bg: #2a1b44;
    --hint-border: #3f2a68;
    --disabled-bg: #3a2c5c;
    --disabled-text: #8f82b0;
    --add-btn-bg: #14532d;
    --add-btn-hover: #166534;
    --text-light: #ffffff;
    --shadow: rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    margin: 0 15px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-color);
}

.cart-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
}

.cart-icon.cart-pop {
    animation: cartPop 0.4s ease;
}

@keyframes cartPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--surface-hover);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

#cart-count {
    background: var(--badge-bg, #ffffff);
    color: var(--badge-text, #3b2670);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50%;
    position: absolute;
    top: -10px;
    right: -10px;
}

/* Hero con parallax (transform por JS) */
.hero-parallax {
    position: relative;
    height: 60vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 0 20px;
}

.hero-parallax > img {
    position: absolute;
    left: 0;
    top: -20%;
    width: 100%;
    height: 140%;
    object-fit: cover;
    will-change: transform;
    transform: translateY(var(--parallax-offset, 0));
}

.hero-parallax .hero-content {
    position: relative;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content p {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #ffffff;
    background: #3b2670;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-primary {
    padding: 18px 44px;
    font-size: 1.15rem;
    background: var(--cta-bg, var(--accent-color));
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: var(--transition);
    display: inline-block;
    margin-top: 0;
}

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

html[data-theme="dark"] .btn-primary {
    --cta-bg: #3b2670;
}

/* Catalogo */
.catalog {
    padding: 4rem 5%;
    text-align: center;
}

.catalog h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    text-align: left;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.product-options {
    margin-bottom: 1.5rem;
}

.option-row {
    display: flex;
    gap: 10px;
}

.option-group {
    flex: 1;
    margin-bottom: 10px;
}

.center-row {
    justify-content: center;
    margin-top: 10px;
}

.product-options label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.product-options select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-dark);
    font-family: inherit;
    cursor: pointer;
}

.qty-selector {
    display: inline-block;
}

.qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--surface);
    width: 100px;
    justify-content: space-between;
}

.qty-controls button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: 0.2s;
}

.qty-controls button:hover {
    background-color: var(--surface-hover);
}

.qty-controls span {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-add {
    width: 100%;
    padding: 12px;
    background: var(--add-btn-bg, var(--primary-color));
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--add-btn-hover, var(--text-secondary));
}

/* Tabla de Talles */
.size-chart-section {
    padding: 4rem 5%;
    background: var(--secondary-color);
    text-align: center;
}

.size-chart-section h2 {
    margin-bottom: 2rem;
}

.size-chart {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.size-chart th, .size-chart td {
    padding: 15px;
    border-bottom: 1px solid var(--border-soft);
}

.size-chart th {
    background: var(--add-btn-bg, var(--accent-color));
    color: var(--text-light);
    text-align: left;
}

.size-chart tr:hover {
    background: var(--surface-soft);
}

/* Carrito Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90%;
    height: 100vh;
    height: 100dvh;
    background: var(--secondary-color);
    z-index: 2000;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -5px 0 15px var(--shadow);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.cart-header h3 {
    margin: 0;
}

#close-cart {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    padding: 1.5rem;
}

.cart-item {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 1rem;
}

.cart-item-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.cart-item-size {
    font-weight: 600;
    color: var(--text-secondary);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-controls .qty-controls {
    width: 92px;
}

.cart-item-total {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.cart-item-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.cart-item-controls .qty-controls button {
    padding: 5px 10px;
}

.cart-footer {
    padding: 1rem 1.2rem max(1.2rem, env(safe-area-inset-bottom));
    background: var(--surface-soft);
    border-top: 1px solid var(--border-soft);
}

.cart-footer .shipping-info {
    margin-bottom: 1rem;
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.8rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.site-footer a:hover {
    color: #E1306C;
}

.site-footer a svg {
    flex-shrink: 0;
}

.btn-whatsapp:disabled,
.btn-whatsapp.btn-disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.btn-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.shipping-info {
    margin-bottom: 1rem;
    display: block;
}

.shipping-info h4 {
    margin-bottom: 0.6rem;
    font-size: 1rem;
    font-weight: 800;
}

.shipping-info input,
.shipping-info select,
.shipping-info textarea {
    width: 100%;
    padding: 9px 10px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-dark);
    cursor: pointer;
}

.delivery-methods {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.7rem;
}

.delivery-option {
    flex: 1;
}

.delivery-option input {
    display: none;
}

.delivery-option span {
    display: block;
    text-align: center;
    padding: 9px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}

.delivery-option em {
    display: block;
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.delivery-option input:checked + span {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

html[data-theme="dark"] .delivery-option input:checked + span {
    background: var(--add-btn-bg, #14532d);
    border-color: var(--add-btn-bg, #14532d);
}

.delivery-option input:checked + span em {
    color: var(--text-secondary);
}

.delivery-moto,
.delivery-sucursal {
    margin-bottom: 0.5rem;
}

.hint-box {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--hint-bg);
    border: 1px solid var(--hint-border);
    border-radius: 5px;
    padding: 7px 9px;
    margin-bottom: 0.6rem;
}

.hint-box a {
    color: #0a66c2;
    font-weight: 700;
    text-decoration: underline;
}

.sucursal-status {
    font-size: 0.72rem;
    color: #e67e22;
    margin-top: 0.2rem;
    font-weight: 600;
}

.sucursal-status.is-api {
    color: #27ae60;
}

/* Totales con desglose */
.totals-box {
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: var(--surface);
    padding: 10px 12px;
    margin-bottom: 1rem;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 3px 0;
    color: var(--text-secondary);
}

.totals-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    border-top: 1px solid var(--border-soft);
    padding-top: 7px;
    margin-top: 3px;
}

.shipping-info input:focus,
.shipping-info select:focus,
.shipping-info textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.payment-info {
    background: var(--surface);
    border: 1px dashed var(--border-color);
    border-radius: 5px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.7rem;
}

.payment-info p {
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.payment-info ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-info li {
    font-size: 0.8rem;
    background: var(--bg-color);
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.pay-details {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
}

.checkbox-container input {
    width: auto;
    margin-top: 2px;
    cursor: pointer;
}

.btn-whatsapp {
    width: 100%;
    padding: 13px 15px;
    background: var(--whatsapp-green);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* ====== RESPONSIVE ====== */

/* Tablet y pantallas medianas */
@media (max-width: 1024px) {
    .hero-parallax { height: 50vh; }
    .product-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* Móvil */
@media (max-width: 768px) {
    .navbar { padding: 0.8rem 4%; }
    .logo { font-size: 1.4rem; }
    .nav-links { gap: 10px; }
    .nav-links a { font-size: 0.85rem; margin: 0; }

    .catalog, .size-chart-section { padding: 2.5rem 4%; }
    .catalog h2, .size-chart-section h2 { font-size: 1.8rem; margin-bottom: 2rem; }

    .product-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
    .product-card { padding: 1rem; }
    .product-card img { height: 180px; }
    .product-title { font-size: 0.9rem; }
    .product-price { font-size: 1.05rem; margin-bottom: 1rem; }

    .option-row { flex-direction: column; gap: 6px; }
    .qty-selector { display: block; }
    .qty-controls { margin: 0 auto; }

    .size-chart th, .size-chart td { padding: 12px; font-size: 0.9rem; }

    .cart-sidebar { width: 100%; max-width: 100%; }

    .cart-item { align-items: flex-start; }
    .cart-item-controls { flex-wrap: wrap; align-items: center; }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .logo { font-size: 1.2rem; }
    .nav-links a { font-size: 0.72rem; }
    .product-grid { grid-template-columns: 1fr; }
    .product-card img { height: 220px; }

    .payment-info ul { flex-direction: column; gap: 6px; }
}
