* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #0f0f0f;
    color: white;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #531CFD, #00BBF1);
    padding: 20px 15px;
    box-shadow: 0 4px 20px rgba(83, 28, 253, 0.3);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-container { display: flex; align-items: center; gap: 15px; }
.logo { height: 50px; width: auto; }
.logo-text h1 { font-size: 1.4rem; margin: 0; }
.logo-text p { font-size: 0.85rem; opacity: 0.95; }

.cta-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

main { padding: 20px 15px; max-width: 800px; margin: 0 auto; }

.mode-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.mode-tab {
    flex: 1;
    padding: 14px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    color: #888;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.mode-tab.active {
    background: linear-gradient(135deg, #531CFD, #00BBF1);
    border-color: #531CFD;
    color: white;
}

.card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #2a2a2a;
}
.card h2 { color: #00BBF1; margin-bottom: 20px; font-size: 1.2rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.badge { background: #531CFD; color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    cursor: pointer;
    background: #262626;
    padding: 12px;
    border-radius: 10px;
}
.toggle-label input { width: 20px; height: 20px; margin: 0; accent-color: #00BBF1; }
.toggle-slider { width: 46px; height: 24px; background: #444; border-radius: 50px; position: relative; transition: 0.3s; }
.toggle-slider::after { content: ''; position: absolute; width: 20px; height: 20px; background: white; border-radius: 50%; top: 2px; left: 2px; transition: 0.3s; }
.toggle-label input:checked + .toggle-slider { background: #25D366; }
.toggle-label input:checked + .toggle-slider::after { left: 24px; }
.toggle-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.toggle-text span { color: #666; }
.toggle-text span.active { color: #00BBF1; font-weight: 600; }

label { display: block; margin-bottom: 8px; color: #00BBF1; font-weight: 600; }
input[type="number"], input[type="text"], select {
    width: 100%;
    padding: 14px;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    background: #262626;
    color: white;
    font-size: 1rem;
    margin-bottom: 15px;
}
input:focus, select:focus { outline: none; border-color: #00BBF1; }
small { display: block; color: #666; font-size: 0.8rem; margin: 4px 0 15px; }

.tabla-productos { margin: 15px 0; }
.tabla-header {
    display: grid;
    grid-template-columns: 0.8fr 2fr 1fr 1fr 0.5fr;
    gap: 8px;
    padding: 10px;
    background: #262626;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #00BBF1;
}
.fila-item {
    display: grid;
    grid-template-columns: 0.8fr 2fr 1fr 1fr 0.5fr;
    gap: 8px;
    padding: 10px;
    background: #262626;
    border-radius: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.fila-item input { margin: 0; padding: 10px; }
.fila-item .col-subtotal { text-align: right; font-weight: 600; color: #00BBF1; padding: 0 10px; }

.btn-delete {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-add {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed #00BBF1;
    color: #00BBF1;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.alerta-sunat {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border-left: 5px solid #f59e0b;
}

.opciones-adicionales {
    margin-top: 20px;
    padding: 20px;
    background: #262626;
    border-radius: 10px;
}
.opciones-adicionales h3 { color: #00BBF1; margin-bottom: 15px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; margin: 12px 0; cursor: pointer; }
.checkbox-label input { width: 20px; height: 20px; margin: 0; accent-color: #00BBF1; }
.checkbox-label span { color: #a0a0a0; }
.opcion-container { margin-left: 30px; margin-bottom: 15px; }
.opcion-row { display: flex; gap: 10px; align-items: center; }
.opcion-row select { width: 80px; margin: 0; }
.opcion-row input { flex: 1; margin: 0; }

.resumen-grid { display: flex; flex-direction: column; gap: 10px; }
.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: #262626;
    border-radius: 10px;
}
.resumen-item.total {
    background: linear-gradient(135deg, #531CFD, #00BBF1);
    font-size: 1.2rem;
}
.resumen-item strong { color: #00BBF1; font-size: 1.2rem; font-weight: 700; }
.resumen-item.total strong { color: white; }
.btn-copy {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #888;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 1rem;
    border-radius: 6px;
    width: auto;
    margin: 0;
}
.btn-copy:hover { background: #00BBF1; color: white; }

.son-box {
    margin-top: 20px;
    padding: 15px;
    background: #262626;
    border-radius: 10px;
    border-left: 4px solid #531CFD;
}
.son-box strong { color: #531CFD; margin-right: 8px; }
.son-box span { color: #a0a0a0; font-size: 0.9rem; }
.fecha-box { text-align: center; padding-top: 15px; margin-top: 15px; border-top: 1px dashed #2a2a2a; color: #666; font-size: 0.85rem; }

button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
}
.btn-whatsapp { background: linear-gradient(135deg, #25D366, #20bd5a); color: white; }
.btn-secondary { background: #262626; color: white; border: 2px solid #3a3a3a; }

.cta-epack {
    background: linear-gradient(135deg, #531CFD, #00BBF1);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
}
.cta-epack h3 { margin: 0 0 8px; color: white; }
.cta-epack p { margin: 0 0 16px; opacity: 0.95; color: white; }
.btn-cta {
    display: inline-block;
    background: white;
    color: #531CFD;
    padding: 14px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    width: auto;
}

.seo-local { text-align: center; padding: 15px; color: #666; font-size: 0.85rem; margin-top: 20px; }

footer { text-align: center; padding: 30px 20px; color: #666; font-size: 0.85rem; border-top: 1px solid #2a2a2a; margin-top: 30px; }
footer a { color: #00BBF1; text-decoration: none; }
.credit { margin-top: 10px; font-size: 0.8rem; }

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #25D366;
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s;
    z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; }
    .logo-container { flex-direction: column; }
    .fila-item, .tabla-header { grid-template-columns: 0.7fr 1.3fr 0.8fr 0.8fr 0.4fr; }
}
@media (max-width: 480px) {
    .logo-text h1 { font-size: 1.1rem; }
    .fila-item, .tabla-header { grid-template-columns: 0.8fr 1fr 0.7fr 0.7fr 0.4fr; }
    .opcion-row { flex-direction: column; align-items: stretch; }
    .opcion-row select { width: 100%; }
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #531CFD;
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}