/* ==========================================================================
   NMSolutions eCommerce - estilos globales
   Complementa el tema material de Radzen. Mobile-first y responsivo.
   ========================================================================== */

:root {
    --nms-brand: #0a66c2;
    --nms-brand-dark: #07437f;
    --nms-surface: #f8fafc;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--nms-surface);
}

/* -------- Blazor error UI (oculto por defecto, aparece ante desconexion) -------- */
#blazor-error-ui {
    background: #fffbea;
    color: #7a4f01;
    border-top: 1px solid #f5c518;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.1);
    display: none;
    left: 0;
    padding: .75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: .75rem;
}

/* ==========================================================================
   Header principal: fondo de marca + texto blanco para maximo contraste
   ========================================================================== */
.nms-header {
    background: linear-gradient(135deg, var(--nms-brand) 0%, var(--nms-brand-dark) 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

/* Fuerza todo el texto e iconos del header en blanco (titulo, nombre de usuario,
   toggle del sidebar, chevrons del profile menu, etc.). */
.nms-header,
.nms-header .nms-header-title,
.nms-header .rz-text,
.nms-header .rzi,
.nms-header .rz-icon,
.nms-header .rz-button,
.nms-header .rz-sidebar-toggle,
.nms-header .rz-profile-menu,
.nms-header .rz-profile-menu > * {
    color: #fff !important;
}

.nms-header .rz-button:hover,
.nms-header .rz-sidebar-toggle:hover {
    background: rgba(255, 255, 255, .12) !important;
}

.nms-header-company-logo {
    height: 34px;
    max-width: 220px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    padding: 2px 6px;
}

/* -------- Carrito en el header -------- */
.nms-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: .35rem .85rem .35rem .55rem;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1;
    transition: background .15s ease, transform .15s ease;
}
.nms-cart-btn:hover {
    background: rgba(255, 255, 255, .24);
    transform: translateY(-1px);
}
.nms-cart-btn:active { transform: translateY(0); }

.nms-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
}
.nms-cart-icon .rzi,
.nms-cart-icon .rz-icon {
    font-size: 1.35rem;
    color: #fff;
}

.nms-cart-badge {
    position: absolute;
    top: -.35rem;
    right: -.55rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .3rem;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--nms-brand-dark);
}

.nms-cart-amount {
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

.nms-profile-menu,
.nms-profile-menu .rz-profile-menu-button,
.nms-profile-label {
    display: inline-flex;
    align-items: center;
}

.nms-profile-label {
    gap: .35rem;
    line-height: 1;
}

.nms-profile-label .rzi,
.nms-profile-label .rz-icon {
    font-size: 1.25rem;
}

.nms-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    border-radius: 999px;
    padding: .2rem .65rem;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
}

.nms-stock-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: .5rem;
    color: #4b5563;
    font-size: .78rem;
    font-weight: 600;
}

.nms-stock-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.nms-stock-filter {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    cursor: pointer;
}

.nms-stock-dot {
    display: inline-flex;
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.nms-stock-empty {
    background: #6b7280;
    color: #374151;
}

.nms-stock-warning {
    background: #f59e0b;
    color: #92400e;
}

.nms-stock-ok {
    background: #16a34a;
    color: #166534;
}

.nms-product-image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nms-product-image,
.nms-product-image-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 8px;
}

.nms-product-image {
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.nms-product-image-previewable {
    cursor: zoom-in;
}

.nms-product-image-popup {
    position: fixed;
    z-index: 2000;
    width: 360px;
    height: 360px;
    padding: 14px;
    pointer-events: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

.nms-product-image-popup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nms-product-image-placeholder {
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
}

.nms-product-description {
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
}

.nms-product-code {
    margin-top: .25rem;
    font-size: .78rem;
    color: #6b7280;
}

.nms-whatsapp-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.nms-whatsapp-button:hover {
    background: #1fb857;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
}

.nms-whatsapp-button svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

/* ==========================================================================
   Layout de login
   ========================================================================== */
.nms-login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a66c2 0%, #1b3c6b 100%);
    padding: 1.5rem;
}

.nms-login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.nms-login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.nms-login-brand img {
    max-width: 180px;
    height: auto;
}

.nms-login-form .rz-textbox,
.nms-login-form .nms-login-input {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #fff;
}

.nms-login-form .nms-login-input:focus {
    outline: none;
    border-color: var(--nms-brand, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.nms-login-form .nms-login-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.nms-login-form .rz-input-icon-wrapper {
    position: relative;
}
.nms-login-form .rz-input-icon-wrapper .rzi {
    position: absolute;
    top: 50%;
    left: .6rem;
    transform: translateY(-50%);
    color: #6b7280;
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: normal;
    font-variation-settings: 'opsz' 24;
}

.nms-label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #4b5563;
    margin-bottom: .35rem;
}

.nms-login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.nms-login-row a {
    color: var(--nms-brand);
    text-decoration: none;
    font-size: .9rem;
}
.nms-login-row a:hover { text-decoration: underline; }

.nms-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .9rem;
    color: #374151;
}

.nms-login-btn {
    width: 100%;
    justify-content: center;
    margin-top: .5rem;
}

.nms-login-footer {
    margin-top: 1.5rem;
    color: rgba(255,255,255,.85);
    font-size: .85rem;
}
.nms-login-footer a { color: inherit; text-decoration: underline; }

/* ==========================================================================
   Ofertas en home
   ========================================================================== */
.nms-offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.nms-offer-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-align: center;
}

.nms-offer-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
}

/* ==========================================================================
   Banner
   ========================================================================== */
.nms-banner-card {
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.nms-banner-img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 8px;
}

.nms-banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 240px;
}

/* ==========================================================================
   Landing publica
   ========================================================================== */
.nms-landing-layout {
    min-height: 100vh;
    background: #f8fafc;
}

.nms-landing {
    color: #111827;
}

.nms-landing-topbar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    padding: .45rem 1rem;
    background: #102a62;
    color: #fff;
    font-size: .86rem;
    font-weight: 600;
}

.nms-landing-topbar a {
    color: #fff;
    text-decoration: none;
}

.nms-landing-topbar a:hover {
    text-decoration: underline;
}

.nms-landing-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 4rem);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.nms-landing-logo img {
    height: 58px;
    max-width: min(340px, 52vw);
    object-fit: contain;
}

.nms-landing-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .75rem;
}

.nms-landing-nav a {
    color: #1f2937;
    font-weight: 700;
    text-decoration: none;
}

.nms-landing-nav a:hover {
    color: var(--nms-brand);
}

.nms-landing-hero {
    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 4rem) 0;
}

.nms-landing-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
}

.nms-landing-slide {
    position: relative;
    min-height: clamp(240px, 28vw, 380px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 26%, rgba(59, 130, 246, .45), transparent 30%),
        linear-gradient(135deg, #0f1f4d 0%, #0a66c2 55%, #15a36d 100%);
}

.nms-landing-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .42;
}

.nms-landing-slide-image-only {
    min-height: auto;
    aspect-ratio: 16 / 4;
    background: #fff;
}

.nms-landing-slide-image-only img {
    opacity: 1;
}

.nms-landing-slide-copy {
    position: relative;
    z-index: 1;
    max-width: 680px;
    padding: clamp(2rem, 6vw, 5rem);
    color: #fff;
}

.nms-landing-slide-copy span {
    display: inline-flex;
    margin-bottom: .75rem;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.nms-landing-slide-copy h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1;
}

.nms-landing-slide-copy p {
    margin: 0 0 1.5rem;
    max-width: 560px;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.5;
}

.nms-landing-slide-copy button,
.nms-landing-product button,
.nms-landing-footer button {
    border: 0;
    border-radius: 999px;
    padding: .75rem 1.35rem;
    background: #f97316;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(249, 115, 22, .28);
}

.nms-landing-carousel-control {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .48);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.nms-landing-carousel-control:hover {
    background: rgba(15, 23, 42, .7);
}

.nms-landing-carousel-prev {
    left: 1rem;
}

.nms-landing-carousel-next {
    right: 1rem;
}

.nms-landing-carousel-indicators {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    z-index: 2;
    display: flex;
    gap: .45rem;
    transform: translateX(-50%);
}

.nms-landing-carousel-indicators button {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
}

.nms-landing-carousel-indicators button.active {
    width: 28px;
    background: #fff;
}

.nms-landing-section {
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 4vw, 4rem) 0;
}

.nms-landing-section-title {
    text-align: center;
    margin-bottom: 1.75rem;
}

.nms-landing-section-title h2 {
    margin: 0;
    color: #102a62;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.nms-landing-section-title p {
    margin: .5rem 0 0;
    color: #64748b;
}

.nms-landing-category-grid,
.nms-landing-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.nms-landing-category,
.nms-landing-contact-card {
    min-height: 240px;
    border: 0;
    border-radius: 22px;
    padding: 2rem;
    color: #fff;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
    transition: transform .15s ease, box-shadow .15s ease;
}

.nms-landing-category:hover,
.nms-landing-contact-card:hover,
.nms-landing-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, .2);
}

.nms-landing-category-medicamentos {
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(135deg, #164e9a, #0a66c2);
}

.nms-landing-category-descartables {
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(135deg, #0f766e, #16a34a);
}

.nms-landing-category span,
.nms-landing-contact-card span {
    display: block;
    font-size: 2rem;
    font-weight: 900;
}

.nms-landing-category strong,
.nms-landing-contact-card strong {
    display: block;
    max-width: 420px;
    margin-top: .7rem;
    font-size: 1.05rem;
    line-height: 1.45;
}

.nms-landing-category em {
    display: inline-flex;
    margin-top: 2rem;
    font-style: normal;
    font-weight: 900;
}

.nms-landing-brand-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: .9rem;
}

.nms-landing-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 86px;
    padding: .8rem;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    color: #102a62;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.nms-landing-contact-grid {
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 4vw, 4rem) 0;
}

.nms-landing-contact-card {
    min-height: 180px;
    background: linear-gradient(135deg, #128c7e, #25d366);
}

.nms-landing-contact-card-alt {
    background: linear-gradient(135deg, #102a62, #0a66c2);
}

.nms-landing-best-sellers {
    padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.nms-landing-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.nms-landing-product {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    min-height: 100%;
    border-radius: 20px;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .1);
    transition: transform .15s ease, box-shadow .15s ease;
}

.nms-landing-product-star {
    position: absolute;
    top: .8rem;
    left: .8rem;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-weight: 900;
}

.nms-landing-product img,
.nms-landing-product-placeholder {
    width: 100%;
    height: 170px;
    border-radius: 16px;
    background: #f8fafc;
}

.nms-landing-product img {
    object-fit: contain;
    border: 1px solid #e5e7eb;
}

.nms-landing-product-placeholder {
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

.nms-landing-product h3 {
    margin: .2rem 0 0;
    color: #111827;
    font-size: .98rem;
    line-height: 1.3;
}

.nms-landing-product p {
    margin: 0;
    color: #64748b;
    font-size: .84rem;
}

.nms-landing-empty {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 18px;
    background: #fff;
    color: #64748b;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.nms-landing-footer {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 2rem;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 4rem);
    background: #102a62;
    color: #fff;
}

.nms-landing-footer h3 {
    margin: 0 0 1rem;
    color: #fff;
}

.nms-landing-footer a,
.nms-landing-footer span {
    display: block;
    margin-bottom: .45rem;
    color: rgba(255, 255, 255, .86);
    text-decoration: none;
}

.nms-landing-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.nms-landing-copy {
    padding: .9rem 1rem;
    background: #0b1e48;
    color: rgba(255, 255, 255, .82);
    text-align: center;
    font-size: .9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
    .nms-login-card { padding: 1.25rem; }
    .nms-offer-img { height: 110px; }
}

@media (max-width: 1024px) {
    .nms-landing-brand-grid,
    .nms-landing-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nms-landing-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .nms-landing-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .nms-landing-nav {
        justify-content: flex-start;
    }

    .nms-landing-category-grid,
    .nms-landing-contact-grid,
    .nms-landing-product-grid,
    .nms-landing-brand-grid {
        grid-template-columns: 1fr;
    }

    .nms-landing-slide-copy {
        padding: 2rem;
    }
}
