:root {
    --space-black: #040612;
    --deep-space: #080d22;
    --panel-bg: rgba(7, 11, 28, 0.84);
    --panel-strong: rgba(5, 8, 20, 0.96);
    --star-cyan: #20f7ff;
    --nebula-pink: #ff2bd6;
    --nebula-violet: #7c3cff;
    --plasma-green: #74ffbd;
    --solar-yellow: #fff04d;
    --warning-orange: #ffb347;
    --moon-white: #eef7ff;
    --muted-star: rgba(238, 247, 255, 0.72);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 0 0 108px;
    color: var(--moon-white);
    font-family: 'Orbitron', sans-serif;
    background:
        radial-gradient(circle at 16% 12%, rgba(124, 60, 255, 0.38), transparent 28%),
        radial-gradient(circle at 84% 18%, rgba(32, 247, 255, 0.24), transparent 24%),
        radial-gradient(circle at 52% 86%, rgba(255, 43, 214, 0.22), transparent 34%),
        linear-gradient(135deg, var(--space-black), var(--deep-space) 52%, #02030a);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(32,247,255,0.76) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,43,214,0.58) 0 1px, transparent 1.5px);
    background-position: 18px 24px, 70px 92px, 138px 48px;
    background-size: 120px 120px, 176px 176px, 244px 244px;
    opacity: 0.68;
}

.scan-line {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9998;
    width: 100%;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--star-cyan), var(--nebula-pink), transparent);
    box-shadow: 0 0 16px rgba(32, 247, 255, 0.72);
    animation: scan 6s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }
    14%,
    72% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
    }
}

.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32,247,255,0.028) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black 0 54%, transparent 84%);
}

.particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: float 16s infinite linear;
}

.particle:nth-child(odd) {
    background: var(--star-cyan);
    box-shadow: 0 0 12px var(--star-cyan);
}

.particle:nth-child(even) {
    background: var(--nebula-pink);
    box-shadow: 0 0 12px var(--nebula-pink);
}

.particle:nth-child(3n) {
    background: var(--plasma-green);
    box-shadow: 0 0 12px var(--plasma-green);
}

@keyframes float {
    0% {
        opacity: 0;
        transform: translateY(104vh) translateX(0) rotate(0deg);
    }
    12%,
    88% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) translateX(90px) rotate(360deg);
    }
}

.container-inicio {
    position: relative;
    z-index: 1;
    width: min(1220px, 100%);
    margin: 0 auto;
    padding: 14px 10px 24px;
}

.header {
    text-align: center;
    margin: 6px 0 12px;
}

.neon-text {
    margin: 14px 0 8px;
    color: var(--moon-white);
    font-size: clamp(2rem, 8vw, 4.2rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow:
        0 0 10px rgba(32, 247, 255, 0.88),
        0 0 24px rgba(124, 60, 255, 0.72),
        0 0 46px rgba(255, 43, 214, 0.46);
}

.neon-text::after {
    content: "";
    display: block;
    width: min(460px, 82vw);
    height: 2px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, var(--star-cyan), var(--nebula-pink), transparent);
    box-shadow: 0 0 18px rgba(32, 247, 255, 0.7);
}

.container {
    display: flex;
    justify-content: center;
    margin: 12px 0 14px;
}

.container a {
    text-decoration: none;
}

.inicio {
    min-height: 42px;
    border: 1px solid rgba(32, 247, 255, 0.86);
    border-radius: 8px;
    padding: 10px 18px;
    color: var(--moon-white);
    background:
        linear-gradient(135deg, rgba(32,247,255,0.18), rgba(255,43,214,0.16)),
        rgba(5, 8, 20, 0.76);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 0 14px rgba(32, 247, 255, 0.34),
        inset 0 0 16px rgba(124, 60, 255, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.inicio:hover,
.inicio:focus-visible {
    transform: translateY(-2px);
    border-color: var(--nebula-pink);
    box-shadow:
        0 0 22px rgba(32, 247, 255, 0.58),
        0 0 30px rgba(255, 43, 214, 0.38),
        inset 0 0 18px rgba(255, 43, 214, 0.16);
    outline: none;
}

.tabla-principal {
    width: min(1100px, calc(100% - 18px));
    margin: 16px auto;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    border: 1px solid rgba(32, 247, 255, 0.62);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.07), transparent 28%),
        var(--panel-bg);
    box-shadow:
        0 0 0 1px rgba(255, 43, 214, 0.20),
        0 16px 46px rgba(0, 0, 0, 0.46),
        0 0 26px rgba(32, 247, 255, 0.22),
        inset 0 0 28px rgba(124, 60, 255, 0.14);
    backdrop-filter: blur(12px);
}

.tabla-principal thead {
    display: table-header-group;
}

.tabla-principal tbody {
    display: table-row-group;
}

.tabla-principal tr {
    display: table-row;
}

.tabla-principal th,
.tabla-principal td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(32, 247, 255, 0.22);
    text-align: left;
    vertical-align: middle;
}

.tabla-principal th {
    color: #041018;
    background: linear-gradient(90deg, var(--star-cyan), var(--plasma-green));
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: none;
}

.tabla-principal th:first-child {
    width: auto;
    text-align: left;
}

.tabla-principal th:nth-child(2) {
    width: 130px;
}

.tabla-principal th:nth-child(3) {
    width: 170px;
}

.tabla-principal td:first-child {
    width: auto;
}

.tabla-principal td:nth-child(2) {
    width: 130px;
}

.tabla-principal td:nth-child(3) {
    width: 170px;
}

.tabla-principal tbody tr {
    min-height: 58px;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.tabla-principal tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.tabla-principal tbody tr:last-child td {
    border-bottom: 0;
}

.tabla-principal tbody tr:hover {
    background: rgba(32, 247, 255, 0.07);
    box-shadow: inset 0 0 18px rgba(255, 43, 214, 0.10);
}

.product-name {
    display: table-cell;
    color: var(--plasma-green);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 0 10px rgba(116, 255, 189, 0.42);
}

.product-name .price-tag,
.product-name .promo-badge,
.product-name .product-status {
    margin-left: 8px;
    vertical-align: middle;
}

.product-subtotal {
    color: var(--solar-yellow);
    width: 130px;
    font-weight: 900;
    text-align: center !important;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 240, 77, 0.48);
}

.price-tag,
.promo-badge,
.product-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1;
}

.price-tag {
    color: var(--solar-yellow);
    border: 1px solid rgba(255, 240, 77, 0.62);
    background: rgba(255, 240, 77, 0.10);
    box-shadow: 0 0 10px rgba(255, 240, 77, 0.18);
}

.promo-badge {
    color: #061018;
    background: linear-gradient(90deg, var(--solar-yellow), var(--plasma-green));
    font-weight: 900;
    box-shadow: 0 0 16px rgba(116, 255, 189, 0.42);
}

.product-status {
    color: var(--warning-orange);
    border: 1px solid rgba(255, 179, 71, 0.55);
    background: rgba(255, 179, 71, 0.10);
    font-style: italic;
    text-decoration: line-through;
    text-shadow: 0 0 8px rgba(255, 179, 71, 0.45);
}

.quantity-controls {
    display: grid;
    grid-template-columns: 40px 54px 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.quantity-controls button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}

.quantity-controls button:hover:not(:disabled) {
    transform: scale(1.08);
    filter: drop-shadow(0 0 8px rgba(32, 247, 255, 0.72));
}

.quantity-controls button:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.quantity-controls button img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.quantity-controls input {
    width: 54px;
    height: 36px;
    border: 1px solid rgba(255, 43, 214, 0.72);
    border-radius: 8px;
    color: var(--moon-white);
    background: rgba(2, 5, 16, 0.82);
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.38);
}

.quantity-controls input:focus {
    border-color: var(--star-cyan);
    outline: none;
    box-shadow:
        0 0 12px rgba(32, 247, 255, 0.35),
        inset 0 0 12px rgba(124, 60, 255, 0.16);
}

.footer-controls {
    position: sticky;
    bottom: 0;
    z-index: 16;
    width: min(1100px, calc(100% - 18px));
    margin: 18px auto 0;
    padding: 12px;
    border: 1px solid rgba(32, 247, 255, 0.52);
    border-radius: 8px;
    background: rgba(4, 6, 18, 0.90);
    box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.42), 0 0 22px rgba(32, 247, 255, 0.16);
    backdrop-filter: blur(14px);
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.total-display {
    color: var(--moon-white);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 0 10px rgba(32, 247, 255, 0.36);
}

.total-display span {
    color: var(--solar-yellow);
    text-shadow: 0 0 12px rgba(255, 240, 77, 0.52);
}

.action-buttons button,
.modal-buttons button {
    min-height: 42px;
    min-width: 128px;
    border: 1px solid rgba(32, 247, 255, 0.78);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--moon-white);
    background:
        linear-gradient(135deg, rgba(32,247,255,0.18), rgba(255,43,214,0.16)),
        rgba(5, 8, 20, 0.76);
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(32, 247, 255, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-buttons button.reset,
.modal-buttons button.close {
    border-color: rgba(255, 43, 214, 0.72);
}

.action-buttons button.confirm,
.modal-buttons button.save {
    border-color: rgba(116, 255, 189, 0.82);
}

.action-buttons button:hover:not(:disabled),
.modal-buttons button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 20px rgba(32, 247, 255, 0.48),
        0 0 26px rgba(255, 43, 214, 0.28);
}

.action-buttons button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

#modalConfirmacion {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(1, 3, 10, 0.82);
    backdrop-filter: blur(8px);
}

.modal-content {
    width: min(94vw, 560px);
    max-height: 88vh;
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(32, 247, 255, 0.70);
    border-radius: 8px;
    color: var(--moon-white);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 28%),
        var(--panel-strong);
    box-shadow:
        0 0 0 1px rgba(255, 43, 214, 0.22),
        0 0 34px rgba(32, 247, 255, 0.36),
        inset 0 0 32px rgba(124, 60, 255, 0.16);
}

.modal-header h3 {
    margin: 0 0 12px;
    color: var(--moon-white);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 14px rgba(255, 43, 214, 0.56);
}

.modal-content table {
    width: 100%;
    margin: 18px 0;
    border-collapse: collapse;
}

.modal-content th,
.modal-content td {
    padding: 9px;
    border-bottom: 1px solid rgba(32, 247, 255, 0.24);
}

.modal-content th {
    color: #061018;
    background: linear-gradient(90deg, var(--star-cyan), var(--plasma-green));
    font-weight: 900;
    text-transform: uppercase;
}

.paid-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 14px;
}

.paid-checkbox input {
    width: 22px;
    height: 22px;
    accent-color: var(--plasma-green);
}

.paid-checkbox label {
    color: var(--star-cyan);
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.contact-info {
    width: min(760px, calc(100% - 24px));
    margin: 24px auto 0;
    padding: 16px;
    border: 1px solid rgba(116, 255, 189, 0.62);
    border-radius: 8px;
    background: rgba(5, 8, 20, 0.68);
    text-align: center;
    box-shadow:
        0 0 18px rgba(116, 255, 189, 0.22),
        inset 0 0 18px rgba(32, 247, 255, 0.08);
}

.contact-info h2 {
    margin: 0;
    color: var(--moon-white);
    font-size: clamp(0.9rem, 4vw, 1.35rem);
    text-transform: uppercase;
}

.contact-info span {
    color: var(--plasma-green);
    text-shadow: 0 0 12px rgba(116, 255, 189, 0.56);
}

@media (max-width: 768px) {
    body {
        padding-bottom: 138px;
    }

    .container-inicio {
        padding: 10px 6px 18px;
    }

    .tabla-principal {
        width: calc(100% - 8px);
        display: table;
        table-layout: fixed;
        overflow: hidden;
        white-space: normal;
    }

    .tabla-principal th,
    .tabla-principal td {
        padding: 10px 6px;
        border-bottom-color: rgba(32, 247, 255, 0.26);
        vertical-align: middle;
    }

    .tabla-principal th:first-child,
    .tabla-principal td:first-child {
        width: 40%;
    }

    .tabla-principal th:nth-child(2),
    .tabla-principal td:nth-child(2) {
        width: 23%;
        text-align: center;
    }

    .tabla-principal th:nth-child(3),
    .tabla-principal td:nth-child(3) {
        width: 37%;
        text-align: center;
    }

    .tabla-principal th:first-child {
        width: 40%;
        min-width: 0;
        text-align: left;
    }

    .tabla-principal th:nth-child(2) {
        width: 23%;
        min-width: 0;
        text-align: center;
    }

    .tabla-principal th:nth-child(3) {
        width: 37%;
        min-width: 0;
        text-align: center;
    }

    .tabla-principal th {
        font-size: 12px;
        letter-spacing: 0;
    }

    .product-name {
        min-width: 0;
        display: table-cell;
        font-size: 1rem;
        line-height: 1.25;
        white-space: normal;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .product-name .price-tag,
    .product-name .promo-badge,
    .product-name .product-status {
        width: fit-content;
        margin: 5px 0 0;
    }

    .price-tag,
    .promo-badge,
    .product-status {
        min-height: 22px;
        padding: 3px 6px;
        font-size: 0.76rem;
    }

    .product-subtotal {
        font-size: 0.95rem;
        width: auto;
        padding-right: 4px;
        padding-left: 4px;
    }

    .quantity-controls {
        grid-template-columns: 34px 42px 34px;
        gap: 3px;
        justify-content: center;
    }

    .quantity-controls button {
        width: 34px;
        height: 36px;
    }

    .quantity-controls button img {
        width: 31px;
        height: 31px;
    }

    .quantity-controls input {
        width: 42px;
        height: 32px;
        font-size: 16px;
    }

    .footer-controls {
        width: 100%;
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        border-radius: 8px 8px 0 0;
    }

    .action-buttons {
        gap: 8px;
    }

    .action-buttons button {
        min-width: 104px;
        min-height: 40px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .total-display {
        order: -1;
        width: 100%;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .tabla-principal th,
    .tabla-principal td {
        padding: 8px 4px;
    }

    .tabla-principal th {
        font-size: 11px;
    }

    .product-name {
        font-size: 0.94rem;
    }

    .quantity-controls {
        grid-template-columns: 31px 38px 31px;
        gap: 2px;
    }

    .quantity-controls button {
        width: 31px;
        height: 34px;
    }

    .quantity-controls button img {
        width: 28px;
        height: 28px;
    }

    .quantity-controls input {
        width: 38px;
        font-size: 15px;
    }
}
