:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8f9ff;
    --surface-muted: #eef2ff;
    --border: #dfe5f2;
    --text: #1f2740;
    --muted: #7b869b;
    --accent: #6c5ce7;
    --accent-strong: #8e7cff;
    --radius: 18px;
    --shadow-soft: 0 10px 30px rgba(25, 32, 53, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

a:hover,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(108, 92, 231, 0.45);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

header {
    background: #ffffff;
    border-bottom: 1px solid rgba(110, 128, 170, 0.14);
    box-shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
    padding: 20px;
}

.header-superior {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.banner {
    flex: 1;
    text-align: center;
}

.banner h1 {
    color: #20263a;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin: 0;
}

.icono-mobile {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 22px;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.icono-mobile:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
    transform: translateY(-2px);
}

#contadorCarrito {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff7a59, #ff4f7a);
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(255, 87, 106, 0.35);
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    margin-top: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    transition: 0.25s ease;
    font-size: 0.96rem;
    font-weight: 600;
}

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

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.search-bar input {
    width: min(520px, 100%);
    padding: 14px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
    transition: 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(25, 32, 53, 0.04);
}

.search-bar input:focus {
    border-color: rgba(108, 92, 231, 0.42);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12);
}

.search-bar input::placeholder {
    color: #98a2b6;
}

.search-bar button,
#btnMostrarTodo,
#btnMostrarTipoCambio,
.cart button,
.product button,
.modal-botones button,
#btnAceptarModal,
#btnCancelarModal {
    border-radius: 999px;
    color: white;
    font-weight: 700;
    transition: all 0.25s ease;
}

.search-bar button,
#btnMostrarTodo,
#btnMostrarTipoCambio,
.cart button,
.product button,
#btnAceptarModal {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    background-size: 200%;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.18);
}

.search-bar button:hover,
#btnMostrarTodo:hover,
#btnMostrarTipoCambio:hover,
.cart button:hover,
.product button:hover,
#btnAceptarModal:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(108, 92, 231, 0.28);
}

.search-bar button {
    padding: 12px 22px;
}

main {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 320px;
    gap: 22px;
    padding: 22px;
    align-items: start;
}

.categories,
.cart,
.gallery {
    background: var(--surface);
    border: 1px solid rgba(110, 128, 170, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.categories,
.cart {
    padding: 20px;
}

.categories h2,
.cart h2,
.gallery h2 {
    margin-bottom: 16px;
    color: #20263a;
    font-size: 1.35rem;
    font-weight: 800;
}

.categories ul,
.cart ul {
    list-style: none;
    padding-left: 0;
}

.categoryList li {
    cursor: pointer;
    width: 100%;
    display: block;
    border: none;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    background-size: 200%;
    color: white;
    font-weight: 700;
    border-radius: 999px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 18px rgba(108, 92, 231, 0.18);
}

.categoryList li:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(108, 92, 231, 0.28);
}

.categoryList li.active {
    background: linear-gradient(135deg, #5647d8, #7d6eff);
    color: white;
}

#btnMostrarTodo,
#btnMostrarTipoCambio {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 15px;
}

.gallery {
    padding: 22px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 22px;
}

.product {
    background: var(--surface);
    padding: 16px;
    border-radius: 18px;
    text-align: left;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(110, 128, 170, 0.16);
    box-shadow: var(--shadow-soft);
}

.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(25, 32, 53, 0.14);
}

.product img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px rgba(110, 128, 170, 0.12);
}

.product h3 {
    margin-top: 14px;
    margin-bottom: 8px;
    color: #20263b;
    font-size: 1.05rem;
    font-weight: 800;
}

.product p {
    color: #222841;
    font-size: 1.18rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.product button {
    margin-top: 14px;
    padding: 11px 16px;
    letter-spacing: 0.02em;
}

.product button:active {
    transform: scale(0.98);
}

.cart-items li {
    font-size: 0.95rem;
    animation: aparecer 0.25s ease;
}

.producto-carrito {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface-soft);
    border: 1px solid rgba(110, 128, 170, 0.14);
    border-radius: 14px;
    padding: 10px 12px;
}

.producto-carrito span {
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 600;
}

.btnEliminar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #fff0f2;
    color: #e14e6d;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btnEliminar:hover {
    background: #ffdddf;
}

#totalCarrito {
    margin-top: 16px;
    font-size: 1.08rem;
    font-weight: 800;
    color: #23263a;
}

.cart button {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
}

footer {
    background: var(--surface);
    padding: 18px 20px;
    margin-top: 8px;
    border-top: 1px solid rgba(110, 128, 170, 0.14);
}

.bottom-menu ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    flex-wrap: wrap;
}

.bottom-menu a {
    color: var(--muted);
    text-decoration: none;
    transition: 0.25s ease;
    font-size: 0.92rem;
}

.bottom-menu a:hover {
    color: var(--accent);
}

.separador {
    margin: 20px 0;
    border: none;
    height: 1px;
    background: rgba(110, 128, 170, 0.18);
}

#resultadoTipoCambio {
    margin-top: 16px;
    background: var(--surface-soft);
    border: 1px solid rgba(110, 128, 170, 0.16);
    border-radius: 16px;
    padding: 14px;
}

#estadoTipoCambio {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 0.94rem;
    font-weight: 800;
}

#listaTipoCambio li {
    background: white;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    border-left: 4px solid var(--accent);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(25, 32, 53, 0.05);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(25, 32, 53, 0.38);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal.activo {
    opacity: 1;
    visibility: visible;
}

.modal-contenido {
    width: 420px;
    max-width: 90%;
    background: white;
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    border: 1px solid rgba(110, 128, 170, 0.18);
    box-shadow: 0 20px 50px rgba(31, 40, 71, 0.16);
    animation: zoom 0.25s ease;
}

.modal-contenido h2 {
    color: #222841;
    margin-bottom: 12px;
    font-size: 1.6rem;
}

.modal-contenido p {
    color: #59647a;
    margin-bottom: 22px;
    font-size: 0.98rem;
    line-height: 1.65;
}

.modal-botones {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-botones button {
    min-width: 120px;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

#btnCancelarModal {
    background: #e7ebf5;
    color: #222841;
}

#btnCancelarModal:hover {
    background: #d8dfef;
}

#btnAceptarModal {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
}

#btnAceptarModal:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(108, 92, 231, 0.26);
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoom {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
        align-items: center;
    }

    .search-bar input,
    .search-bar button {
        width: 100%;
        max-width: 420px;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    nav ul {
        flex-direction: column;
        gap: 12px;
    }

    .header-superior {
        gap: 10px;
    }

    .icono-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .banner h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 16px;
        gap: 16px;
    }

    .categories,
    .cart,
    .gallery {
        border-radius: 16px;
    }

    #panelCategorias {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        background: white;
        z-index: 9999;
        overflow-y: auto;
        transition: left 0.35s ease;
        padding: 20px;
        box-shadow: 10px 0 24px rgba(25, 32, 53, 0.14);
    }

    #panelCategorias.activo {
        left: 0;
    }

    #panelCarrito {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        background: white;
        z-index: 9999;
        overflow-y: auto;
        transition: right 0.35s ease;
        padding: 20px;
        box-shadow: -10px 0 24px rgba(25, 32, 53, 0.14);
    }

    #panelCarrito.activo {
        right: 0;
    }

    .btnCerrarPanel {
        display: block;
        margin-left: auto;
        margin-bottom: 16px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #eef1fb;
        color: #23263a;
        font-size: 20px;
        cursor: pointer;
        transition: 0.25s;
    }

    .btnCerrarPanel:hover {
        background: var(--accent);
        color: white;
    }
}

#overlayMobile {
    position: fixed;
    inset: 0;
    background: rgba(19, 24, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s;
    z-index: 9000;
    backdrop-filter: blur(2px);
}

#overlayMobile.activo {
    opacity: 1;
    visibility: visible;
}

.mobile-buttons {
    display: none;
}

@media (max-width: 480px) {
    .modal-contenido {
        width: 95%;
        padding: 20px;
    }

    .modal-contenido h2 {
        font-size: 1.35rem;
    }

    .modal-contenido p {
        font-size: 0.95rem;
    }

    .modal-botones {
        flex-direction: column;
    }

    .modal-botones button {
        width: 100%;
    }
}
