:root {
    --green-950: #171923;
    --green-900: #23263a;
    --green-700: #2f80ed;
    --green-100: #eef3ff;
    --cream: #f6f4f0;
    --paper: #ffffff;
    --ink: #171923;
    --muted: #6d7280;
    --gold: #ff7a59;
    --orange: #b56cff;
    --danger: #b73e3e;
    --line: rgba(23, 25, 35, 0.12);
    --shadow: 0 22px 55px rgba(23, 25, 35, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

a {
    color: inherit;
}

.store-hero {
    min-height: 460px;
    padding: 18px clamp(18px, 5vw, 76px) 58px;
    color: white;
    background:
        linear-gradient(90deg, rgba(23, 25, 35, 0.92), rgba(35, 38, 58, 0.78), rgba(23, 25, 35, 0.28)),
        url("https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.store-nav,
.nav-actions,
.hero-actions,
.form-actions,
.admin-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-nav {
    justify-content: space-between;
    margin-bottom: 70px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    color: inherit;
    background: transparent;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--green-950);
    background: var(--green-100);
    border-radius: 50%;
    font-weight: 900;
}

.ghost-btn,
.secondary-link,
.primary-link,
.cart-pill,
.pay-btn,
.clear-btn,
.danger-btn,
.add-btn,
.icon-btn,
.mini-btn {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ghost-btn {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cart-pill,
.primary-link,
.pay-btn,
.add-btn {
    color: var(--green-950);
    background: var(--gold);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.cart-pill span {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    margin-left: 8px;
    place-items: center;
    color: white;
    background: var(--green-950);
    border-radius: 50%;
}

.secondary-link,
.clear-btn {
    color: var(--green-950);
    background: var(--green-100);
    border: 1px solid var(--line);
}

.danger-btn {
    color: white;
    background: var(--danger);
}

.ghost-btn:hover,
.primary-link:hover,
.secondary-link:hover,
.pay-btn:hover,
.add-btn:hover,
.cart-pill:hover,
.danger-btn:hover {
    transform: translateY(-1px);
}

.hero-copy {
    width: min(620px, 100%);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.auth-card h1,
.admin-hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    line-height: 1.02;
}

.hero-copy h1 {
    max-width: 560px;
    font-size: clamp(2.3rem, 6vw, 4.9rem);
}

.hero-copy p:not(.eyebrow) {
    max-width: 520px;
    margin: 18px 0 28px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.7;
}

.benefits-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: min(1120px, calc(100% - 32px));
    margin: -34px auto 0;
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.benefits-row div {
    padding: 12px 16px;
    border-right: 1px solid var(--line);
}

.benefits-row div:last-child {
    border-right: 0;
}

.benefits-row strong,
.benefits-row span {
    display: block;
}

.benefits-row span,
.muted-text,
.auth-copy,
.section-heading p {
    color: var(--muted);
}

.store-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 58px auto;
}

.store-shell.compact {
    margin-top: 30px;
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading h2,
.auth-card h1,
.admin-hero h1 {
    color: var(--green-950);
    font-size: clamp(2rem, 4vw, 3rem);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.producto-card,
.auth-card,
.admin-form,
.admin-tools,
.admin-product-card,
.alert-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(20, 47, 36, 0.1);
}

.producto-card {
    overflow: hidden;
}

.product-media {
    position: relative;
    height: 190px;
    background: linear-gradient(135deg, var(--green-100), #fff);
}

.product-media img,
.admin-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--green-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 4rem;
    font-weight: 900;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 5px 10px;
    color: white;
    background: var(--green-700);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.product-media .stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.stock-low {
    background: var(--orange);
}

.stock-out {
    background: var(--danger);
}

.product-body {
    padding: 18px;
}

.product-body h3,
.admin-product-card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.product-body p,
.admin-product-card p {
    min-height: 48px;
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.product-meta strong {
    font-size: 1.15rem;
}

.product-meta span {
    color: var(--muted);
    font-size: 0.9rem;
}

.add-btn,
.pay-btn,
.clear-btn,
.full-width {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(20, 47, 36, 0.35);
}

.cart-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 11;
    width: min(440px, 100%);
    padding: 24px;
    overflow-y: auto;
    background: var(--paper);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.icon-btn,
.mini-btn {
    display: inline-grid;
    place-items: center;
    color: var(--green-950);
    background: var(--green-100);
}

.icon-btn {
    width: 42px;
    padding: 0;
}

.empty-cart,
.checkout-box,
.cart-items {
    display: grid;
    gap: 12px;
}

.empty-cart {
    padding: 18px;
    color: var(--muted);
    background: white;
    border-radius: 8px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.mini-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin: 22px 0;
    padding: 18px;
    color: white;
    background: var(--green-950);
    border-radius: 8px;
}

.checkout-box {
    padding: 18px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.checkout-box label,
.form-stack label,
.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
}

.input-control,
.file-control {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--ink);
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}

.input-control:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 4px rgba(47, 97, 61, 0.12);
}

.demo-cards {
    display: grid;
    gap: 8px;
    margin: 4px 0;
}

.demo-cards p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.demo-cards button {
    padding: 10px;
    color: var(--green-950);
    text-align: left;
    background: var(--green-100);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.alert-card {
    margin-top: 16px;
    padding: 14px 16px;
    font-weight: 800;
}

.alert-card.success {
    color: #245c38;
    background: #ecf6ec;
}

.alert-card.danger {
    color: #8a2f2f;
    background: #fff0ed;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background:
        linear-gradient(rgba(247, 241, 228, 0.9), rgba(247, 241, 228, 0.94)),
        url("https://images.unsplash.com/photo-1523381294911-8d3cead13475?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.auth-card {
    width: min(460px, 100%);
    padding: 30px;
}

.auth-card.wide {
    width: min(680px, 100%);
}

.auth-brand,
.admin-brand {
    margin-bottom: 28px;
    color: var(--green-950);
}

.auth-copy {
    line-height: 1.6;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
    grid-column: span 2;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 38px clamp(18px, 5vw, 76px);
    color: white;
    background:
        linear-gradient(90deg, rgba(23, 25, 35, 0.96), rgba(47, 128, 237, 0.72)),
        url("https://images.unsplash.com/photo-1445205170230-053b83016050?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.admin-hero h1,
.admin-hero .admin-brand {
    color: white;
}

.admin-hero p:not(.eyebrow) {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.82);
}

.admin-stats {
    display: flex;
    align-items: end;
    gap: 14px;
}

.admin-stats div {
    min-width: 120px;
    padding: 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.admin-stats strong {
    display: block;
    font-size: 2rem;
}

.admin-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    width: min(1120px, calc(100% - 32px));
    margin: 34px auto;
}

.admin-form,
.admin-tools {
    padding: 24px;
}

.admin-tools {
    display: grid;
    align-content: start;
    gap: 12px;
}

.admin-form h2,
.admin-tools h2 {
    margin: 0;
}

.admin-products {
    display: grid;
    gap: 16px;
}

.admin-product-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
}

.admin-product-media {
    height: 96px;
    overflow: hidden;
    background: var(--green-100);
    border-radius: 8px;
}

.admin-product-media .product-placeholder {
    font-size: 2rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 420px;
    padding: 14px 48px 14px 16px;
    color: white;
    background: var(--danger);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 10px;
    right: 14px;
    color: white;
    text-decoration: none;
}

@media (max-width: 920px) {
    .store-nav,
    .admin-hero,
    .admin-shell,
    .admin-product-card {
        grid-template-columns: 1fr;
    }

    .store-nav,
    .admin-hero {
        display: grid;
    }

    .nav-actions,
    .admin-stats {
        flex-wrap: wrap;
    }

    .benefits-row,
    .productos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell {
        display: grid;
    }
}

@media (max-width: 640px) {
    .store-hero {
        min-height: 560px;
    }

    .nav-actions,
    .hero-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ghost-btn,
    .cart-pill,
    .primary-link,
    .secondary-link {
        width: 100%;
        text-align: center;
    }

    .benefits-row,
    .productos-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .benefits-row div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .benefits-row div:last-child {
        border-bottom: 0;
    }

    .span-2 {
        grid-column: auto;
    }

    .auth-card,
    .admin-form,
    .admin-tools {
        padding: 20px;
    }

    .admin-card-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
