/* Paleta y radio: ver theme.css (formato shadcn "H S% L%", se usan como hsl(var(--x))) */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.page-main {
    flex: 1;
    background: hsl(var(--background));
    padding: 0.5rem;
}

.center-screen {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: hsl(var(--background));
    padding: 1rem;
}

.break-all {
    word-break: break-all;
}

/* ---------- Header / Footer ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: hsl(var(--background) / 0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px hsl(240 5.9% 10% / 0.08);
}

.site-header-inner {
    margin: 0 auto;
    max-width: 80rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.site-header-logo {
    margin: 0;
}

.site-header-logo img {
    height: 3rem;
    display: block;
}

.site-footer {
    margin-top: 1rem;
    background: hsl(var(--muted));
}

.site-footer.mt-0 {
    margin-top: 0;
}

.site-footer-inner {
    margin: 0 auto;
    max-width: 80rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-siian {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.footer-siian a {
    margin-left: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: hsl(var(--foreground));
}

.footer-siian a:hover {
    text-decoration: underline;
}

/* ---------- Hero (home) ---------- */

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, hsl(var(--background)), hsl(var(--muted) / 0.4));
}

.hero-inner {
    margin: 0 auto;
    max-width: 80rem;
    padding: 2rem 1.5rem;
    display: grid;
    align-items: center;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.hero-badge {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid hsl(var(--primary) / 0.2);
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.hero-title {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.hero-title-accent {
    color: hsl(var(--primary));
}

.hero-description {
    margin: 0 auto;
    max-width: 60ch;
    font-size: 1.05rem;
    line-height: 1.6;
    color: hsl(var(--muted-foreground));
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.hero-features i {
    color: hsl(var(--primary));
    margin-right: 0.25rem;
}

.hero-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 1rem;
    padding: 0.85rem 1.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-hero-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-hero-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 24px hsl(var(--primary) / 0.25);
}

.btn-hero-secondary {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background) / 0.6);
    color: hsl(var(--foreground));
}

.btn-hero-secondary:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 24px hsl(240 5.9% 10% / 0.12);
}

.hero-image-wrap {
    display: none;
    justify-content: center;
}

.hero-image-card {
    border: 1px solid hsl(var(--border));
    border-radius: 1.5rem;
    background: hsl(var(--background) / 0.4);
    padding: 2rem;
    box-shadow: 0 25px 50px -12px hsl(240 5.9% 10% / 0.25);
}

.hero-image-card img {
    height: 20rem;
    width: 20rem;
    object-fit: cover;
    border-radius: 0.75rem;
}

/* ---------- Cards ---------- */

.card {
    background: hsl(var(--background));
    border-radius: var(--radius);
    box-shadow: 0 10px 24px hsl(240 5.9% 10% / 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.25rem 1.5rem;
}

.card-header-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.card-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-header-plain {
    padding: 1.5rem 1.5rem 0;
}

.card-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-description {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
}

.login-card {
    width: 24rem;
    max-width: 100%;
}

.login-card .card-content {
    padding-top: 1rem;
}

/* ---------- Formularios ---------- */

.form-field {
    margin-bottom: 0.9rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---------- Info usuario / producto ---------- */

.page-heading {
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.page-heading h1 {
    margin: 0 0 0.5rem;
    font-size: 1.875rem;
    font-weight: 700;
}

.page-heading p {
    margin: 0;
    color: hsl(var(--muted-foreground));
}

.wallet-section {
    margin: 0 auto;
    max-width: 56rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.info-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.info-item p {
    margin: 0.15rem 0 0;
    font-size: 1.125rem;
    font-weight: 600;
    overflow-wrap: break-word;
}

/* ---------- Estados ---------- */

.status-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: currentColor;
}

.status-green { color: hsl(142 72% 29%); }
.status-yellow { color: hsl(45 93% 35%); }
.status-orange { color: hsl(25 95% 45%); }
.status-red { color: hsl(0 74% 50%); }
.status-gray { color: hsl(240 4% 46%); }
.status-blue { color: hsl(217 91% 50%); }
.status-purple { color: hsl(271 81% 50%); }
.status-cyan { color: hsl(188 86% 40%); }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: hsl(var(--muted-foreground));
}

.badge.badge-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge.status-green { background: hsl(var(--primary)); color: #fff; }
.badge.status-yellow { background: hsl(45 93% 47%); color: #fff; }
.badge.status-orange { background: hsl(25 95% 53%); color: #fff; }
.badge.status-red { background: hsl(0 84% 60%); color: #fff; }
.badge.status-gray { background: hsl(240 4% 56%); color: #fff; }
.badge.status-blue { background: hsl(217 91% 60%); color: #fff; }
.badge.status-purple { background: hsl(271 81% 56%); color: #fff; }
.badge.status-cyan { background: hsl(188 86% 53%); color: #fff; }

/* ---------- Opciones de pago ---------- */

.payment-options {
    display: grid;
    gap: 1rem;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 4px 12px hsl(240 5.9% 10% / 0.1);
}

.payment-option-info {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 1rem;
}

.payment-option-icon {
    flex-shrink: 0;
    border-radius: var(--radius);
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    padding: 0.5rem;
    display: flex;
}

.payment-option-icon i {
    font-size: 1.25rem;
    color: hsl(var(--primary));
}

.payment-option-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.payment-option-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.payment-option-info p {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.payment-option-amount {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.payment-option-amount p {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.payment-option-amount i {
    color: hsl(var(--muted-foreground));
}

.custom-payment {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
}

.custom-payment-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.custom-payment-head h3 {
    margin: 0;
    font-weight: 600;
}

.custom-payment-head p {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.custom-payment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-payment-input {
    flex: 1;
}

.custom-payment-input .hint {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

/* ---------- Layout cobranza (productos + carrito) ---------- */

.rc-layout {
    margin: 0 auto;
    width: 100%;
    max-width: 80rem;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
}

.rc-main {
    min-width: 0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.btn-back:hover {
    text-decoration: underline;
}

/* ---------- Lista de productos ---------- */

.product-list {
    display: grid;
    gap: 1rem;
}

.product-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.product-item:hover {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 4px 12px hsl(240 5.9% 10% / 0.1);
}

.product-item h3 {
    margin: 0;
    font-weight: 600;
}

.product-item p {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.product-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-item-id {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-item-data {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-item-data > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-item-data span {
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
}

.product-item-amount {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.product-item-amount span {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.product-item-amount strong {
    font-size: 1.25rem;
}

.product-item-row {
    flex-direction: column;
}

.product-item-end {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.product-item-end strong {
    font-size: 1.25rem;
}

/* ---------- Carrito ---------- */

.cart-aside .cart-card {
    position: sticky;
    top: 82px;
}

.cart-empty {
    padding: 2rem 0;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.cart-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.cart-empty-hint {
    font-size: 0.875rem;
}

.cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.5);
    padding: 0.75rem;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-type {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.cart-item-number {
    margin: 0;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-amount {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.cart-item-remove {
    border: none;
    background: transparent;
    color: hsl(var(--destructive));
    cursor: pointer;
    padding: 0.25rem;
}

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.cart-total-row-final {
    font-weight: 600;
    font-size: 1rem;
}

.cart-limits {
    margin: 1rem 0;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.cart-limits p {
    margin: 0.15rem 0;
}

/* ---------- Transacción ---------- */

.transaction-main {
    flex: 1;
    margin: 0 auto;
    width: 100%;
    max-width: 72rem;
}

.transaction-card-wrap {
    margin: 0 auto;
    width: 100%;
    max-width: 42rem;
    padding: 2rem 1rem;
}

.transaction-card {
    border: 2px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--muted));
    padding: 1rem;
}

.transaction-title {
    margin: 0 0 0.5rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.transaction-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.transaction-row {
    display: flex;
    flex-direction: column;
}

.transaction-row span:first-child {
    font-size: 0.875rem;
    font-weight: 600;
}

.transaction-status {
    align-self: flex-start;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.transaction-status.approved { background: hsl(142 71% 45%); }
.transaction-status.rejected { background: hsl(0 84% 60%); }

.transaction-actions {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.btn-link {
    color: hsl(var(--foreground));
    text-decoration: underline;
    padding: 0.5rem 1rem;
}

/* ---------- Alertas ---------- */

.alert {
    display: flex;
    gap: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    background: hsl(var(--background));
}

.alert i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.alert-title {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.alert-description {
    font-size: 0.875rem;
}

.alert-destructive {
    border-color: hsl(var(--destructive) / 0.5);
    color: hsl(var(--destructive));
}

.alert-info {
    color: hsl(var(--foreground));
}

/* ---------- Popup confirmación ---------- */

.popup-description {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.popup-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.popup-row {
    display: flex;
    gap: 1rem;
}

.popup-row span:first-child {
    font-weight: 600;
    min-width: 9rem;
    text-align: right;
}

.popup-row-strong {
    color: hsl(var(--foreground));
}

/* ---------- Separadores ---------- */

.separator {
    border: none;
    border-top: 1px solid hsl(var(--border));
    margin: 1rem 0;
}

.separator-sm {
    border: none;
    border-top: 1px solid hsl(var(--border));
    margin: 0.5rem 0;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
    .page-main {
        padding: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-item-full {
        grid-column: span 2;
    }

    .hero-links {
        flex-direction: row;
    }

    .custom-payment-form {
        flex-direction: row;
        align-items: flex-start;
    }

    .payment-option {
        flex-direction: row;
        align-items: center;
    }

    .payment-option-amount {
        width: auto;
        justify-content: flex-end;
    }

    .product-item-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .transaction-row {
        flex-direction: row;
        gap: 1rem;
    }

    .transaction-row span:first-child {
        width: 33%;
        text-align: right;
        font-size: 1rem;
    }

    .transaction-actions {
        flex-direction: row;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }

    .hero-content {
        text-align: left;
    }

    .hero-badge {
        align-self: flex-start;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-description {
        margin: 0;
    }

    .hero-features,
    .hero-links {
        justify-content: flex-start;
    }

    .hero-image-wrap {
        display: flex;
        justify-content: flex-end;
    }

    .rc-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* ---------- DevExtreme: colores del tema (theme.css) ---------- */

.dx-button-mode-contained.dx-button-default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: var(--radius);
}

.dx-button-mode-contained.dx-button-default.dx-state-hover,
.dx-button-mode-contained.dx-button-default.dx-state-focused {
    background-color: hsl(var(--primary) / 0.9);
}

.dx-button-mode-contained.dx-button-default .dx-icon {
    color: hsl(var(--primary-foreground));
}

.dx-button-mode-contained.dx-button-danger {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-radius: var(--radius);
}

.dx-texteditor.dx-state-focused.dx-editor-outlined,
.dx-texteditor.dx-state-focused.dx-editor-filled {
    border-color: hsl(var(--ring));
}

.dx-radiobutton-checked .dx-radiobutton-icon-dot {
    background: hsl(var(--primary));
}

.dx-radiobutton-checked .dx-radiobutton-icon::before {
    border-color: hsl(var(--primary));
}
