﻿/* General styles */

/* purpura */
  :root {
    --degradado-purpura: linear-gradient(180deg, rgba(48, 0, 85, 1) 0%, rgba(75, 0, 130, 1) 50%, rgba(29, 0, 51, 1) 100%); 
    --color-purpura: #4B0082;
    --color-gris-claro: #f5f5f5;
}    


/* azul */
 /* :root {
    --degradado-purpura: linear-gradient(180deg, rgb(0, 0, 115) 0%, rgb(0, 0, 51) 100%);
    --color-purpura: #000073;    
}  */


/* rojo */
/* :root {
    --degradado-purpura: linear-gradient(180deg, rgb(255, 0, 0) 0%, rgb(139, 0, 0) 100%);
    --color-purpura: #FF0000;    
} */

/* azul tit */
/* :root {
--degradado-purpura: linear-gradient(180deg, rgba(0, 83, 119, 1) 0%, rgba(0, 47, 75, 1) 100%);
--color-purpura: #002f4b;
} */


body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    max-width: 1200px; /* Ajuste del ancho mÃ¡ximo del body */
    margin: 0 auto; /* Centrar el body */
    padding-top: var(--cloudshop-header-offset, 105px); /* Se sincroniza con la altura real de la cabecera fija */
    transition: background 0.5s ease-out; /* TransiciÃ³n del fondo */
}

body, body * {
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */   
    -webkit-tap-highlight-color: transparent; /* Remove highlight on mobile devices */
}





/* Estilos para notificaciones Toast */
#toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
    transition: visibility 0.5s, opacity 0.5s linear;
    opacity: 0;
}

#toast.show {
    visibility: visible;
    opacity: 1;
}

/* El aviso de cliente reemplaza visualmente al boton mientras esta visible. */
#toast.toast-cover-target {
    left: var(--toast-target-left);
    bottom: var(--toast-target-bottom);
    width: var(--toast-target-width);
    height: var(--toast-target-height);
    min-width: 0;
    margin-left: 0;
    padding: 8px 16px;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

/* Estilos para el Modal de Producto */
.modal {
    display: none;
    position: fixed;
    /* z-index: 1000; <-- Se definirÃ¡ por ID */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    padding-top: 60px;
}

#orderPreviewModal { z-index: 1050; }
#paymentMethodsModal { z-index: 1060; }
#clientDetailsModal { z-index: 1070; }
#productModal { z-index: 1040; }
#branchStockModal { z-index: 1040; }

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

/* En el modal de detalle (y sucursales), el header debe ir pegado arriba
   y ocupar todo el ancho del panel, sin padding externo del contenedor */
#productModal .modal-content,
#branchStockModal .modal-content {
    padding: 0;
}

@media (max-width: 768px) {
    #productModal,
    #branchStockModal {
        padding: 0;
        background-color: rgba(0,0,0,0.6);
        display: none; /* Oculto por defecto */
    }

    #productModal.show,
    #branchStockModal.show {
        display: block; /* Visible solo cuando tiene la clase .show */
    }
}

/* Panel complementario de descripcion: solo escritorio. */
.product-detail-description-panel {
    display: none;
}

@media (max-width: 768px) {
    #productModal .product-detail-description-panel {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #productModal .product-detail-mobile-only,
    #productModal .product-detail-mobile-description {
        display: none !important;
    }

    #productModal .product-detail-header-bar,
    .product-detail-description-panel-header {
        height: 50px;
        min-height: 50px;
        box-sizing: border-box;
    }

    #productModal.has-desktop-description .product-detail-description-panel {
        position: absolute;
        top: 0;
        right: 420px;
        z-index: 1;
        display: flex;
        width: clamp(340px, 32vw, 500px);
        max-width: calc(100vw - 420px);
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        overflow: hidden;
        border-right: 0;
        background: #fff;
        box-shadow: -10px 0 24px rgba(15, 23, 42, 0.2);
        box-sizing: border-box;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    #productModal.show.has-desktop-description .product-detail-description-panel.is-visible {
        transform: translateX(0);
    }

    #productModal.has-desktop-description #modalContent {
        box-shadow: none;
    }

    .product-detail-description-panel-header {
        display: flex;
        min-height: 48px;
        flex-shrink: 0;
        align-items: center;
        gap: 10px;
        padding: 9px 16px;
        background: var(--degradado-purpura);
        color: #fff;
        box-sizing: border-box;
        text-align: left;
    }

    .product-detail-description-panel-icon {
        display: inline-flex;
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.12);
    }

    .product-detail-description-panel-eyebrow {
        display: block;
        margin-bottom: 1px;
        font-size: 0.65rem;
        font-weight: 600;
        line-height: 1.1;
        opacity: 0.82;
        text-transform: uppercase;
    }

    .product-detail-description-panel-header h2 {
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.15;
    }

    .product-detail-description-panel-body {
        flex: 1;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 18px 20px 28px;
        border-right: 2px solid rgba(15, 23, 42, 0.18);
        background: #fff;
        color: #1f2937;
        box-sizing: border-box;
        text-align: left;
        user-select: text;
        -webkit-user-select: text;
    }

    #productModal .product-detail-footer,
    .product-detail-description-panel-footer {
        min-height: 56px;
        box-sizing: border-box;
    }

    .product-detail-description-panel-footer {
        display: flex;
        width: 100%;
        flex-shrink: 0;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
        padding: 8px 18px;
        border: 0;
        background: var(--degradado-purpura);
        color: #fff;
        cursor: pointer;
        font: inherit;
        transition: filter 0.18s ease;
    }

    .product-detail-description-panel-footer:hover {
        filter: brightness(1.13);
    }

    .product-detail-description-panel-footer:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.9);
        outline-offset: -4px;
    }

    .product-detail-description-panel-cue {
        display: inline-flex;
        align-items: center;
        gap: 14px;
        opacity: 0;
        transform: translateX(-180px);
        will-change: opacity, transform;
    }

    .product-detail-description-panel-footer.is-cue-visible .product-detail-description-panel-cue {
        animation: product-detail-purchase-cue-enter 0.62s cubic-bezier(0.2, 0.85, 0.3, 1.15) forwards;
    }

    .product-detail-description-panel-footer-label {
        background: linear-gradient(105deg, rgba(255, 255, 255, 0.72) 20%, #fff 43%, #fff 56%, rgba(255, 255, 255, 0.72) 78%);
        background-position: 130% 0;
        background-size: 240% 100%;
        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0;
        line-height: 1.15;
        text-transform: uppercase;
        animation: product-detail-purchase-label-flash 2.1s ease-in-out infinite;
    }

    .product-detail-description-panel-arrows {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        color: #fff;
        font-size: 1rem;
    }

    .product-detail-description-panel-arrows i {
        animation: product-detail-purchase-cue 1.35s ease-in-out infinite;
        opacity: 0.28;
    }

    .product-detail-description-panel-arrows i:nth-child(2) {
        animation-delay: 0.16s;
    }

    .product-detail-description-panel-arrows i:nth-child(3) {
        animation-delay: 0.32s;
    }

    .product-detail-desktop-description-section + .product-detail-desktop-description-section {
        margin-top: 22px;
        padding-top: 18px;
        border-top: 1px solid #e2e8f0;
    }

    .product-detail-desktop-description-subtitle {
        margin: 0 0 10px;
        color: #0f172a;
        font-size: 0.82rem;
        text-transform: uppercase;
    }

    .product-detail-desktop-description-content {
        max-width: 100%;
        overflow-wrap: anywhere;
        color: #334155;
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .product-detail-desktop-description-content > :first-child {
        margin-top: 0;
    }

    .product-detail-desktop-description-content > :last-child {
        margin-bottom: 0;
    }

    .product-detail-desktop-description-content img,
    .product-detail-desktop-description-content video,
    .product-detail-desktop-description-content iframe {
        max-width: 100%;
        height: auto;
    }

    .product-detail-desktop-description-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
    }
}

@keyframes product-detail-purchase-cue {
    0%, 100% {
        opacity: 0.28;
        transform: translateX(-3px);
    }
    50% {
        opacity: 1;
        transform: translateX(3px);
    }
}

@keyframes product-detail-purchase-cue-enter {
    0% {
        opacity: 0;
        transform: translateX(-180px);
    }
    18% {
        opacity: 0.55;
        transform: translateX(-125px);
    }
    78% {
        opacity: 1;
        transform: translateX(6px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes product-detail-purchase-label-flash {
    0%, 18% {
        background-position: 130% 0;
    }
    62%, 100% {
        background-position: -120% 0;
    }
}

#productModal .product-detail-add-btn.purchase-attention {
    animation: product-detail-buy-attention 0.72s ease-in-out 2;
    transform-origin: center;
}

@keyframes product-detail-buy-attention {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        transform: scale(1);
    }
    45% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.3), 0 0 20px rgba(34, 197, 94, 0.55);
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-detail-description-panel-arrows i {
        animation: none;
        opacity: 0.9;
        transform: none;
    }

    .product-detail-description-panel-footer-label {
        animation: none;
        background: none;
        color: #fff;
    }

    .product-detail-description-panel-cue,
    .product-detail-description-panel-footer.is-cue-visible .product-detail-description-panel-cue {
        animation: none;
        opacity: 1;
        transform: none;
    }

    #productModal .product-detail-add-btn.purchase-attention {
        animation: none;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45);
    }
}

.product-detail-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    background-color: #fff;
}

.product-detail-modal.loading {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.product-detail-header {
    flex-shrink: 0;
}

.product-detail-header-bar {
    background: var(--degradado-purpura);
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-detail-back {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    margin-right: 8px;
    cursor: pointer;
}

.product-detail-header-title {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 90px;
}

.product-detail-gallery {
    margin-bottom: 12px;
}

.product-detail-gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    height: clamp(280px, calc(100vw - 32px), 420px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-image-open {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: #f7f7f7;
    cursor: zoom-in;
}

.product-detail-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.product-detail-gallery-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.product-detail-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.product-detail-gallery-nav.prev {
    left: 8px;
}

.product-detail-gallery-nav.next {
    right: 8px;
}

.product-detail-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.product-detail-thumb {
    flex: 0 0 66px;
    width: 66px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0;
    background: #f5f5f5;
    overflow: hidden;
    cursor: pointer;
}

.product-detail-thumb.active {
    border-color: var(--color-purpura);
}

.product-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-detail-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.product-image-lightbox-open {
    overflow: hidden;
}

.product-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.94);
    color: #fff;
}

.product-image-lightbox-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 56px 58px 82px;
}

.product-image-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.18s ease;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.product-image-lightbox-close,
.product-image-lightbox-nav,
.product-image-lightbox-zoom,
.product-image-lightbox-reset {
    border: 0;
    color: #fff;
    cursor: pointer;
}

.product-image-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 2rem;
    line-height: 1;
}

.product-image-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 2.4rem;
    line-height: 1;
    transform: translateY(-50%);
}

.product-image-lightbox-nav.prev {
    left: 10px;
}

.product-image-lightbox-nav.next {
    right: 10px;
}

.product-image-lightbox-toolbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%);
}

.product-image-lightbox-zoom {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #c81010;
    font-size: 1.25rem;
    font-weight: 800;
}

.product-image-lightbox-reset {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
    font-weight: 800;
}

.product-image-lightbox-zoom-label,
.product-image-lightbox-counter {
    min-width: 48px;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.badge-no-stock {
    background: #c0392b;
    color: #fff;
}

.product-detail-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    overflow-x: auto;
}

.product-detail-tab {
    border: none;
    background: #f0f0f0;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.product-detail-tab.active {
    background: var(--degradado-purpura);
    color: #fff;
}

.product-detail-section {
    margin-bottom: 14px;
    text-align: left;
}

.product-detail-name {
    font-size: 1rem;
    margin: 0 0 4px;
}

.product-detail-code {
    font-size: 0.8rem;
    color: #777;
    margin: 0 0 4px;
}

.product-detail-price-main {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 4px 0;
}

.product-detail-stock {
    font-size: 0.85rem;
    color: #555;
}

.product-detail-stock.no-stock {
    color: #c0392b;
    font-weight: 600;
}

.product-detail-stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-detail-stock-branch-btn {
    margin-top: 0;
    border: 1px solid #ddd;
    background: #fafafa;
    color: #333;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.product-detail-stock-branch-btn:hover {
    background: #f0f0f0;
}

.product-detail-stock-branch-btn.highlight {
    background: #ffe082;
    border-color: #ffb300;
    animation: stock-branch-pulse 1s ease-in-out infinite;
}

@keyframes stock-branch-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.7); }
    50% { box-shadow: 0 0 8px 3px rgba(255, 179, 0, 0.9); }
    100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.7); }
}

.branch-stock-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f8fb;
    text-align: left;
}

.branch-stock-summary {
    background: #fff;
    border: 1px solid #eceff5;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.branch-stock-code {
    display: inline-flex;
    margin-bottom: 6px;
    color: #667085;
    font-size: 0.8rem;
    font-weight: 700;
}

.branch-stock-summary h4 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1rem;
    line-height: 1.25;
}

.branch-stock-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fef2f2;
    color: #b42318;
}

.branch-stock-total.available {
    background: #ecfdf3;
    color: #027a48;
}

.branch-stock-total span {
    font-size: 0.84rem;
    font-weight: 700;
}

.branch-stock-total strong {
    font-size: 1.45rem;
    line-height: 1;
}

.branch-stock-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.branch-stock-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #e6e9f0;
    border-left: 5px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    padding: 11px 12px;
}

.branch-stock-row.available {
    border-left-color: #12b76a;
}

.branch-stock-row.empty {
    border-left-color: #f04438;
}

.branch-stock-row.missing {
    border-left-color: #98a2b3;
}

.branch-stock-branch {
    min-width: 0;
}

.branch-stock-branch strong {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-stock-branch span {
    display: inline-flex;
    margin-top: 3px;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
}

.branch-stock-current {
    margin-left: 0;
    border-radius: 999px;
    padding: 2px 7px;
    background: #eef4ff;
    color: #3538cd !important;
}

.branch-stock-qty {
    min-width: 54px;
    border-radius: 999px;
    padding: 7px 10px;
    background: #f2f4f7;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

.branch-stock-row.available .branch-stock-qty {
    background: #dcfae6;
    color: #027a48;
}

.branch-stock-actions {
    margin-top: 12px;
}

.branch-stock-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 999px;
    padding: 11px 14px;
    background: #22c55e;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.branch-stock-note {
    margin: 10px 2px 0;
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.35;
}

.branch-stock-empty,
.branch-stock-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    border: 1px dashed #d0d5dd;
    border-radius: 12px;
    background: #fff;
    color: #475467;
    font-weight: 700;
    text-align: center;
}

.branch-stock-loading {
    gap: 10px;
}

.branch-stock-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #d0d5dd;
    border-top-color: var(--color-principal, #ef1b16);
    border-radius: 50%;
    animation: branch-stock-spin 0.8s linear infinite;
}

@keyframes branch-stock-spin {
    to { transform: rotate(360deg); }
}

.product-detail-lists {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-detail-list-row {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 6px 10px;
    background: #fafafa;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.product-detail-list-row.active {
    border-color: var(--color-purpura);
    background: #f0f4ff;
}

.product-detail-list-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.product-detail-list-price {
    font-weight: 700;
}

.product-detail-list-meta {
    display: flex;
    gap: 6px;
    font-size: 0.74rem;
    flex-wrap: wrap;
}

.product-detail-list-badge {
    padding: 2px 6px;
    border-radius: 999px;
    background: #e3f2fd;
    color: #1565c0;
}

.product-detail-list-min {
    color: #777;
}

.product-detail-list-help {
    font-size: 0.75rem;
    color: #777;
    margin-top: 6px;
}

.product-detail-description {
    max-height: 260px;
    overflow: hidden;
    position: relative;
    font-size: 0.85rem;
}

.product-detail-description.product-detail-description-collapsed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: linear-gradient(to top, #fff, rgba(255,255,255,0));
}

.product-detail-description-toggle {
    margin-top: 6px;
    border: none;
    background: transparent;
    color: var(--color-purpura);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.product-detail-shop-content {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.4;
}

.product-detail-shop-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-detail-empty {
    font-size: 0.8rem;
    color: #777;
}

.product-detail-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--degradado-purpura);
    color: #fff;
}

.product-detail-footer-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}

.product-detail-footer-label {
    opacity: 0.9;
}

.product-detail-footer-price {
    font-size: 1.2rem;
    font-weight: 700;
}

.product-detail-footer-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-detail-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.product-detail-qty-input {
    width: 42px;
    text-align: center;
    border-radius: 8px;
    border: none;
    padding: 4px;
}

.product-detail-add-btn {
    border: none;
    background: #2ecc71;
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

/* Ocultar la X en el modal de detalle de producto */
#productModal .close-modal {
    display: none;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}


/* Estilos para el Modal de Resumen de Pedido */
.modal-content h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

#order-items-container {
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

.order-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.order-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f0f0f0;
}

.order-item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px; /* Espacio entre lÃ­neas de detalle */
    font-size: 0.9em;
}

.order-item-details strong {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.order-item-details span {
    color: #555;
}

.order-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.btn-item-action {
    background-color: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 15px;
    padding: 8px 12px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-item-action:hover {
    background-color: #d1d1d1;
}

/* Botones de confirmar unificados para los 3 pasos del checkout */
#orderPreviewModal .confirm-button,
#paymentMethodsModal .confirm-button,
#clientDetailsModal .confirm-button {
    background-color: #28a745; /* Verde consistente */
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 0;
    width: 100%;
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0; /* Evita que el botÃ³n se encoja */
}

#orderPreviewModal .confirm-button:hover,
#paymentMethodsModal .confirm-button:hover,
#clientDetailsModal .confirm-button:hover {
    background-color: #218838; /* Verde mÃ¡s oscuro al pasar el mouse */
}

/* Flecha hacia la derecha al lado del texto de cada botÃ³n de confirmar */
#orderPreviewModal .confirm-button::after,
#paymentMethodsModal .confirm-button::after,
#clientDetailsModal .confirm-button::after {
    content: " \2192"; /* Flecha Unicode â†’ */
    margin-left: 8px;
    font-size: 1.1em;
}

/* Nuevos estilos para el modal de previsualizaciÃ³n de pedido - Basado en la imagen */
#orderPreviewModal .modal-content,
#paymentMethodsModal .modal-content,
#clientDetailsModal .modal-content {
    padding: 0;        /* sin marco blanco alrededor */
    overflow: hidden;  /* el scroll va en los contenedores internos */
}

.modal-header-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.modal-back-arrow, .modal-header-spacer {
    display: block; /* Visible por defecto (desktop y mobile) */
    flex: 0 0 35px; /* Base fija para centrar el total */
    font-size: 24px;
    cursor: pointer;
    font-weight: bold;
}

.modal-total-bar {
    flex-grow: 1; /* Ocupa el espacio central */
    text-align: center; /* Centra el texto */
    background-color: #ff0;
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.4em;
    font-weight: bold;
}

.modal-close-preview {
    background-color: #f00;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

#order-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
}

.order-item {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.order-item-image {
    width: 80px;
    height: 80px;
}

.order-item-details p {
    margin: 4px 0;
    font-size: 0.9em;
}

.order-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#orderPreviewModal #order-items-container {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

#orderPreviewModal .order-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas: "image details actions";
    column-gap: 10px;
    row-gap: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

#orderPreviewModal .order-item-image {
    grid-area: image;
    width: 72px;
    height: 72px;
}

#orderPreviewModal .order-item-details {
    grid-area: details;
    min-width: 0;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
}

#orderPreviewModal .order-item-details strong,
#orderPreviewModal .order-item-details span {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#orderPreviewModal .order-item-actions {
    grid-area: actions;
    width: auto;
    min-width: 0;
    align-items: center;
}

#orderPreviewModal .order-item-actions .product-controls {
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 6px;
    box-sizing: border-box;
}

#orderPreviewModal .order-item-availability {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
}

.btn-item-action {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
}

#orderPreviewModal .confirm-button {
    border-radius: 0;
    width: 100%;
    margin: 0;
    padding: 15px;
    flex-shrink: 0;
}

/* Estilos para el Skeleton Loader (reintroducido y mejorado) */
.skeleton-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin: 5px;
    padding: 10px;
    width: calc(50% - 10px);
    box-sizing: border-box;
    transform: translateZ(0); /* Promover a su propia capa de composiciÃ³n */
}

.skeleton-image {
    height: 120px;
    background: #f0f0f0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-text {
    height: 18px;
    background: #f0f0f0;
    margin-top: 10px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-text.short {
    width: 60%;
    height: 14px;
}

.shimmer-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ocultar contenido principal hasta que el splash desaparezca */
#main-content {
    display: none;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Estilos para el intro splash */
#intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--degradado-purpura); 
    z-index: 100010; /* Keep the splash above headers, floating controls and overlays. */
    transition: opacity 0.5s ease-out; /* TransiciÃ³n de desvanecimiento */
}

#logo-container {
    width: var(--cloudshop-logo-width, 100px);
    height: var(--cloudshop-logo-height, 90px);
    max-width: min(70vw, var(--cloudshop-logo-width, 100px));
    max-height: min(40vh, var(--cloudshop-logo-height, 90px));
    border-radius: 10%;    
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.45));
    animation: scaleUp 0.45s ease-out forwards;
}

#logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes scaleUp {
    0% {
        transform: scale(1.85);
        opacity: 0.85;
    }
    100% {
        transform: scale(2.2);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Nueva animaciÃ³n para el fondo */
@keyframes backgroundFadeOut {
    0% {
        background: var(--color-purpura); 
    }
    100% {
        background: #f4f4f4;
    }
}

/* Estilos de la cabecera */
.header {
    background: var(--degradado-purpura);
    color: white;
    padding: 4px 5px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;    
}



.header-logo {
    border-radius: 10%; /* Hace que la imagen sea completamente redonda */
    width: var(--cloudshop-logo-width, 100px); /* Ajusta el tamaÃ±o segÃºn tus necesidades */
    height: var(--cloudshop-logo-height, 90px); /* Ajusta el tamaÃ±o segÃºn tus necesidades */
    margin-left: var(--cloudshop-logo-margin-left, 4px);
    margin-top: var(--cloudshop-logo-margin-top, 3px);
    margin-right: 10px;    
    object-fit: contain;
}

.header-logo-link {
    display: inline-flex;
    align-items: flex-start;
    flex: 0 0 auto;
    text-decoration: none;
    cursor: pointer;
}

.header-logo-link:focus-visible {
    outline: 2px solid var(--theme-color, #4B0082);
    outline-offset: 3px;
    border-radius: 10%;
}



@keyframes slide-down {
    from {
        top: -60px;
        opacity: 0;
    }
    to {
        top: 0;
        opacity: 1;
    }
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding-left: 5px; /* Espacio para el botÃ³n de refinar */
    flex-grow: 1;
    margin: 0 10px;
}

.search-input {
    border: none;
    outline: none;
    padding: 10px;
    background-color: transparent;
    flex-grow: 1;
    font-size: 1em;
}

.search-icon {
    padding: 0 12px;
    color: #888;
}

.search-container, .search-group {
    position: relative;
}

.clear-search-btn {
    position: absolute;
    right: 35px; /* A la izquierda del Ã­cono de la lupa */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.1em;
    color: #888;
    cursor: pointer;
    padding: 5px;
}

/* AnimaciÃ³n sutil para nuevas tarjetas de producto */
.product-item {
    animation: product-fade-in 0.25s ease-out;
}

@keyframes product-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Estilos para el wrapper y botones de scroll de categorÃ­as */
.categories-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px; /* Espacio para que los botones no se peguen a los bordes */
    box-sizing: border-box;
    gap: 8px; /* SeparaciÃ³n entre MOSTRAR CATEGORIAS, scroll y lista */
}

.show-categories-btn {
    display: none; /* Oculto por defecto (se muestra solo en desktop) */
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    padding: 8px 14px; /* Un poco mÃ¡s grande */
    border-radius: 22px;
    background: linear-gradient(135deg, #ffeb3b, #ff9800);
    color: #000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    margin-top: 6px; /* SeparaciÃ³n superior sutil */
}

.show-categories-btn i {
    font-size: 0.9rem;
}

.show-categories-btn span {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.scroll-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
    opacity: 1; /* Siempre visible */
    visibility: visible; /* Siempre visible */
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.scroll-btn:hover {
    background-color: #f0f0f0;
}

.scroll-btn.left-scroll {
}

.scroll-btn.right-scroll {
}


/* Estilos para el contenedor de categorÃ­as */
.categories-container {
    width: 100%;
    flex: 1; /* Que ocupe todo el espacio restante en escritorio */
    overflow-x: auto; /* PERMITIR SCROLL */
    background: transparent;
    padding: 0;
    margin-top: 10px;
    scrollbar-width: none; /* Ocultar scrollbar para Firefox */
    -ms-overflow-style: none; /* Ocultar scrollbar para IE/Edge */
    scroll-behavior: smooth;
}

/* Media queries para pantallas mÃ¡s grandes */
@media (max-width: 768px) {
    .scroll-btn {
        display: none;
    }
    .show-categories-btn {
        display: none;
    }
    .categories-container {
        -webkit-overflow-scrolling: touch; /* Suaviza el desplazamiento en dispositivos iOS */
    }     
}




.categories {
    display: flex;
    white-space: nowrap; /* CRÃTICO: Evita el salto de lÃ­nea de las categorÃ­as */
}

/* Estilos para el scroll en navegadores Webkit (Chrome, Safari) */
.categories-container::-webkit-scrollbar {
    display: none; /* Ocultar scrollbar */
}

.categories-container::-webkit-scrollbar-thumb {
    background: #888; /* Color de la barra de desplazamiento */
    border-radius: 4px; /* Bordes redondeados */
}

.categories-container::-webkit-scrollbar-track {
    background: #f4f4f4; /* Color de fondo del track */
}

.category-item {
    background: #fff;
    color: grey;
    padding: 5px 15px;
    margin: 0 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    border: 1px solid var(--degradado-purpura);
    white-space: nowrap; /* Evitar saltos de lÃ­nea */
    text-transform: uppercase;
}

.category-item:hover,
.category-item.active {
    background: yellowgreen;
    color: white;   
}

/* Estilos del carrusel */
.carousel {
    width: 95%;   
    overflow: hidden;
    position: relative;
    margin-top: 55px; /* Espacio adicional para la cabecera */
    margin-bottom: 5px;
    margin-left: auto; /* Centrar el carrusel horizontalmente */
    margin-right: auto; /* Centrar el carrusel horizontalmente */
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra opcional para el carrusel */
    justify-content: center; /* Centrar el contenido del carrusel */
    align-items: center;
    opacity: 0; /* Ocultar inicialmente */
    transform: translateX(-30%); /* Mover fuera de la pantalla a la izquierda */
    animation: slide-in 1s ease-out forwards; /* AnimaciÃ³n de entrada */
}

@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateX(0); /* Mover a la posiciÃ³n original */
    }
}

/* Estilos adicionales del carrusel */
.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 25vh;
}

body.catalog-filter-results .banner-slider,
body.catalog-filter-results .carousel {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.catalog-filter-results .product-list {
    margin-top: 10px;
}

/* Ocultar filtros de escritorio en mÃ³vil por defecto */
.desktop-filters {
    display: none;
}

.catalog-filter-select,
.refine-select {
    height: 34px;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    background: #ffffff;
    color: #263342;
    font: inherit;
}

.catalog-filter-select {
    width: clamp(118px, 11vw, 178px);
    padding: 0 28px 0 9px;
    font-size: 12px;
}

.catalog-records-counter {
    display: none;
}

.refine-select {
    width: 100%;
    padding: 0 34px 0 10px;
    font-size: 14px;
}

/* Media queries para pantallas mÃ¡s grandes */
@media (min-width: 768px) {
    .show-categories-btn {
        display: flex;
    }
    .header-logo {
        height: var(--cloudshop-logo-height, 90px);
        align-self: flex-start;
    }
    .cloudshop-logo-height-expanded .header-content {
        min-height: 42px;
        margin-top: 6px;
        padding-left: calc(var(--cloudshop-logo-category-offset-left, 10px) + 4px);
        padding-right: 12px;
        box-sizing: border-box;
    }
    .cloudshop-logo-height-expanded .header-content .search-container {
        flex: 0 0 295px;
        width: 295px;
        max-width: 295px;
        margin-left: 0;
        box-sizing: border-box;
    }
    .cloudshop-logo-height-expanded .header-content .search-input {
        min-width: 0;
    }
    .cloudshop-logo-height-expanded .header-logo {
        position: absolute;
        left: var(--cloudshop-logo-margin-left, 4px);
        top: var(--cloudshop-logo-margin-top, 3px);
        width: var(--cloudshop-logo-rendered-width, var(--cloudshop-logo-width, 100px));
        margin: 0;
        z-index: 2;
    }
    .categories-wrapper {
        padding-left: var(--cloudshop-logo-category-offset-left, 10px);
    }
    .cloudshop-logo-height-expanded .categories-wrapper {
        margin-top: 6px;
        padding-left: calc(var(--cloudshop-logo-category-offset-left, 10px) + 4px);
        padding-right: 14px;
    }
    .cloudshop-logo-height-expanded .show-categories-btn {
        width: 295px;
        justify-content: center;
        margin-top: 0;
    }
    .scroll-btn.left-scroll {
        left: 155px; /* Desplazar a la derecha para no tapar el botÃ³n MOSTRAR CATEGORIAS */
    }

    .carousel-container {
        height: 50vh;
    }
    .carousel {
        width: 99%;   
        margin-bottom: 10px;
        margin-top: 70px; /* Espacio adicional para la cabecera */

    }        
}


.carousel img {
    min-width: 100%;
    max-height: auto;
    /* object-fit: cover; */
    display: none;
}

.carousel img.active {
    display: block;
}

.carousel .prev, .carousel .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
}

.carousel .prev {
    left: 10px;
}

.carousel .next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
}

.carousel-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dots span.active {
    background: white;
}

/* Estilos de la lista de productos */
.promo-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    background: #f5f7fa;
    scroll-snap-type: x proximity;
}

.promo-card {
    flex: 0 0 min(360px, 86vw);
    min-height: 72px;
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e0e7ef;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    scroll-snap-align: start;
}

.promo-card img {
    width: 112px;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 8px;
    background: #f2f4f7;
}

.promo-card-text {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.promo-card-text strong {
    color: #111827;
    font-size: 0.88rem;
    line-height: 1.1;
}

.promo-card-text small {
    color: #4b5563;
    font-size: 0.74rem;
    line-height: 1.2;
}

.cloudshop-banner-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #f5f7fa;
    margin-top: 10px;
    padding: 0px;
    /* Dejar espacio inferior para que la barra fija del carrito no tape los Ãºltimos productos */
    padding-bottom: 80px;
}

.product-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 5px;
    padding: 0px;
    width: calc(50% - 10px); /* Dos productos por fila para mÃ³viles */
    box-sizing: border-box;
    text-align: center;
    transition: border 0.1s ease, box-shadow 0.2s ease, background-color 0.3s ease; /* TransiciÃ³n para el borde y feedback */
    transform: translateZ(0); /* Promover a su propia capa de composiciÃ³n para evitar parpadeos */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.product-item:hover {
    border: 2px solid rgb(8, 8, 237); /* Borde azul al pasar el mouse */    
}

/* Estado visual cuando se agrega al carrito */
.product-item.added-feedback {
    background-color: #e6ffe6;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.5);
}

/* Estado visual para productos sin stock */
.product-item.out-of-stock {
    opacity: 1;
}

.product-item.out-of-stock .add-to-cart {
    background: #ccc;
    cursor: pointer;
}

.product-item.out-of-stock .product-stock {
    color: #c0392b;
    font-weight: 600;
}

.image-placeholder {
    position: relative;
}

.out-of-stock-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: #c0392b;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-radius: 999px;
    pointer-events: none;
}

.product-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background: #fff;
}

.product-name {
    font-size: 0.9em;
    margin: 3px;
    color: grey;
    white-space: wrap; /* Evitar saltos de lÃ­nea */
    overflow-wrap: break-word; /* TambiÃ©n puede ser word-wrap: break-word; */
    word-break: break-all; /* Fuerza el corte de palabras largas si es necesario */
}

/* CÃ³digo del producto sobre el nombre */
.product-code {
    margin: 4px 6px 0 6px;
    font-size: 0.75em;
    color: #333;
    font-weight: 500;
}

.product-description, .product-price, .product-stock {
    margin: 5px 0;
    font-size: 1em;
}

.product-price{    
    font-size: 1em;
    font-weight: bold;
}

.product-stock {
    font-size: 0.9em;
    color: #555;
    margin-top: -5px; /* Reduce el espacio con el precio */
    margin-bottom: 10px;
}

/* Controles de producto */
.product-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 10px auto 12px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
    position: relative;
    z-index: 3;
}

.product-controls button {
    background: var(--degradado-purpura);
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5em;
    width: 35px;
    height: 35px;
    margin: 0;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.product-controls button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-controls span {
    margin: 0 10px;
    font-size: 1em;
}

.product-controls input.product-quantity {
    text-align: center;
    width: 50px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1.2em;
    padding: 5px;
    background: #fff;
    color: #222;
    font-weight: 700;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Efecto visual al presionar el botÃ³n */
@keyframes button-press {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(0.7);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}





.add-to-cart {
    background: var(--color-purpura);
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8em;
    width: 80%;
    margin-top: 10px; /* Ajuste de espacio */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto; /* Centrar el carrusel horizontalmente */
    margin-right: auto; /* Centrar el carrusel horizontalmente */
    margin-bottom: 5px;
    gap: 7px;
    min-height: 34px;
    line-height: 1.15;
}

.product-category {
    align-self: center;
    max-width: calc(100% - 16px);
    margin: 5px auto 1px;
    padding: 3px 7px;
    overflow: hidden;
    border: 1px solid #dbe4ee;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.66em;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.add-to-cart:hover {
    background:var(--degradado-purpura);
}

.add-to-cart.is-solid {
    background: var(--degradado-purpura);
    font-weight: 700;
}

.add-to-cart.is-outline {
    border: 2px solid var(--color-purpura);
    background: #fff;
    color: var(--color-purpura);
    font-weight: 700;
}

.add-to-cart.is-outline:hover {
    background: #f8fafc;
}

.product-item.out-of-stock .add-to-cart.is-whatsapp,
.add-to-cart.is-whatsapp,
.product-detail-add-btn.is-whatsapp {
    background: #16a34a;
    color: #fff;
}

.product-item.out-of-stock .add-to-cart.is-disabled,
.add-to-cart.is-disabled,
.product-detail-add-btn.is-disabled {
    border-color: #cbd5e1;
    background: #d1d5db;
    color: #64748b;
    cursor: not-allowed;
}

.product-item.available-other-branch {
    border-color: #86efac;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.13);
}

.product-item.available-other-branch .product-stock {
    color: #166534;
    font-weight: 700;
}

.product-item.availability-pending .product-stock,
.product-item.availability-unknown .product-stock {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
}

.product-branch-availability {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: calc(100% - 20px);
    min-height: 32px;
    margin: -2px 10px 5px;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 5px 7px;
    background: #ecfdf3;
    color: #166534;
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    gap: 5px;
}

.product-branch-availability:hover {
    background: #dcfce7;
}

.product-availability-note {
    margin: -4px 8px 3px;
    color: #9a3412;
    font-size: 0.7rem;
    font-weight: 700;
}

.product-detail-stock.other-branch {
    color: #166534;
    font-weight: 700;
}

.product-detail-stock.unknown {
    color: #475569;
    font-weight: 600;
}

.product-detail-stock-branch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.15;
}

.product-detail-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.product-detail-add-btn.is-outline {
    border: 2px solid var(--color-purpura);
    background: #fff;
    color: var(--color-purpura);
}

.product-detail-availability-note {
    color: #fef3c7;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.branch-stock-whatsapp {
    gap: 8px;
}

.checkout-availability-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 14px 4px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 9px 10px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: left;
}

.order-item-availability {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 5px;
    margin-top: 4px;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.order-item-availability.other {
    background: #dcfce7;
    color: #166534;
}

.order-item-availability.subject {
    background: #ffedd5;
    color: #9a3412;
}

.in-cart-label {
    margin-top: 5px;
    color: green;
}

/* SÃ³tano fijo para el carrito */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--degradado-purpura);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 5px;
    z-index: 1000;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Ocultar el cart-footer cuando se estÃ¡ en cualquier paso del checkout */
body.checkout-open .cart-footer {
    display: none !important;
}

/* Carrito superior derecho (versiÃ³n compacta dentro del header) */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;   /* separaciÃ³n respecto a Z-A */
    margin-right: 16px;  /* separaciÃ³n respecto al borde derecho del header */
}

body.checkout-open .cart-header {
    display: none !important;
}

.cart-header .cart-icon {
    width: 30px;
    height: 30px;
}

@media (max-width: 768px) {
    .cart-header {
        display: none !important;
    }
}

.cart-summary {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrar el contenido */
    flex-grow: 1; /* Permitir que crezca para centrar */
}


.cart-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease-in-out; /* Asegura la animaciÃ³n de pulso */
}


.cart-icon {
    width: 30px;
    height: 30px;
}

.total-items-round {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.total-price-large {
    font-size: 1.7em; /* TamaÃ±o de fuente mayor */
}

.order-button {
    background: linear-gradient(135deg, #0f8f31 0%, #16b542 48%, #0e7e2d 100%);
    background-size: 180% 180%;
    background-position: 0% 50%;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 10px 24px 10px 58px; /* Reserva espacio para el indicador sin pegarlo al texto */
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.4em; /* TamaÃ±o de fuente mayor */
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    transform-origin: center center;
    will-change: transform, box-shadow, background-position, filter;
    transition: background-position 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.order-button::before,
.order-button::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 3px solid #ffeb3b;
    border-right: 3px solid #ffeb3b;
    transform: translateY(-50%) rotate(45deg);
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.28));
    pointer-events: none;
    z-index: 1;
}

.order-button::before {
    left: 14px;
    opacity: 0.7;
}

.order-button::after {
    left: 30px;
    opacity: 1;
}

.order-button:hover {
    background-position: 100% 50%;
    filter: brightness(1.05);
}

/* Destacar el botÃ³n PEDIR cuando se agrega un producto */
.order-button-highlight {
    position: relative;
    animation: order-button-pulse 1.55s cubic-bezier(0.22, 1, 0.36, 1) 0s 1 both;
}

.order-button-highlight::before {
    animation: order-button-chevron-soft 1.15s ease-in-out 0s 1 both;
}

.order-button-highlight::after {
    animation: order-button-chevron-soft 1.15s ease-in-out 0.14s 1 both;
}

@keyframes order-button-pulse {
    0% {
        transform: translateY(0) scale3d(1, 1, 1);
        background-position: 0% 50%;
        filter: saturate(1);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 235, 59, 0);
    }
    18% {
        transform: translateY(-3px) scale3d(1.06, 1.06, 1);
        background-position: 60% 50%;
        filter: saturate(1.12) brightness(1.04);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), 0 0 0 10px rgba(255, 235, 59, 0.18);
    }
    36% {
        transform: translateY(1px) scale3d(0.985, 0.985, 1);
        background-position: 100% 50%;
        filter: saturate(1.04) brightness(1.01);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 0 5px rgba(255, 235, 59, 0.08);
    }
    58% {
        transform: translateY(-2px) scale3d(1.035, 1.035, 1);
        background-position: 72% 50%;
        filter: saturate(1.08) brightness(1.03);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22), 0 0 0 6px rgba(255, 235, 59, 0.12);
    }
    78% {
        transform: translateY(0) scale3d(0.994, 0.994, 1);
        background-position: 100% 50%;
        filter: saturate(1.03);
        box-shadow: 0 9px 18px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 235, 59, 0.05);
    }
    100% {
        transform: translateY(0) scale3d(1, 1, 1);
        background-position: 0% 50%;
        filter: saturate(1);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 235, 59, 0);
    }
}

@keyframes order-button-chevron-soft {
    0% {
        transform: translateY(-50%) rotate(45deg) scale(1);
        filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.28));
    }
    30% {
        transform: translate(5px, -50%) rotate(45deg) scale(1.14);
        filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.55));
    }
    58% {
        transform: translate(2px, -50%) rotate(45deg) scale(1.06);
        filter: drop-shadow(0 0 5px rgba(255, 235, 59, 0.32));
    }
    100% {
        transform: translateY(-50%) rotate(45deg) scale(1);
        filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.28));
    }
}




/* Media queries para pantallas mobiles */
@media (max-width: 768px) {   
    .product-item {
        margin: 3px;
    }    
    .add-to-cart {
        padding: 6px 8px;
        font-size: 0.7em;
        width: 90%;
        margin-top: 5px;
    }
}



/* Media queries para pantallas mÃ¡s grandes */
@media (min-width: 768px) {
    .product-item {
        width: calc(25% - 10px); /* Cuatro productos por fila para pantallas medianas */
        position: relative; /* Necesario para posicionar el botÃ³n */
        overflow: hidden; /* Oculta el botÃ³n que se sale */
        padding-bottom: 50px;
    }

    .product-item .add-to-cart, .product-item .product-controls {
        position: absolute;
        bottom: 7px;
        left: 50%;
        transform: translateX(-50%) translateY(120%); /* Empieza abajo y oculto */
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        width: calc(100% - 20px); /* Ajustar ancho para que no se desborde */
        z-index: 2; /* Asegurar que estÃ© por encima de la imagen */
    }

    .product-item .add-to-cart {
        min-height: 34px;
        margin: 0;
        padding: 6px 8px;
    }

    .product-item .product-controls {
        width: auto;
        max-width: calc(100% - 20px);
        margin: 0;
        padding: 3px 8px;
        z-index: 4;
    }

    .product-item .product-branch-availability {
        width: auto;
        max-width: calc(100% - 20px);
        min-height: 22px;
        margin: 0 auto 4px;
        padding: 2px 4px;
        border: 1px solid #86efac;
        border-radius: 6px;
        background: #ecfdf3;
        box-shadow: none;
        font-size: 0.6rem;
        line-height: 1.1;
        gap: 2px;
    }

    .product-item .product-branch-availability span {
        overflow-wrap: anywhere;
    }

    .product-item .product-branch-availability:hover {
        background: #dcfce7;
        color: #15803d;
    }

    .product-item:hover .add-to-cart, .product-item:hover .product-controls {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .product-item.catalog-keyboard-focus,
    .product-item:focus-visible {
        outline: none;
        border-color: var(--theme-color, #4B0082);
        box-shadow:
            0 0 0 3px color-mix(in srgb, var(--theme-color, #4B0082) 32%, transparent),
            0 8px 20px rgba(15, 23, 42, 0.18);
    }

    .product-item.catalog-keyboard-focus .add-to-cart,
    .product-item.catalog-keyboard-focus .product-controls,
    .product-item:focus-visible .add-to-cart,
    .product-item:focus-visible .product-controls {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        visibility: visible;
    }

    body.catalog-keyboard-mode #productList,
    body.catalog-keyboard-mode #productList * {
        cursor: none !important;
    }

    body.catalog-keyboard-mode .product-item:hover:not(.catalog-keyboard-focus) {
        border: 1px solid #ddd;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    body.catalog-keyboard-mode .product-item:hover:not(.catalog-keyboard-focus) .add-to-cart,
    body.catalog-keyboard-mode .product-item:hover:not(.catalog-keyboard-focus) .product-controls {
        transform: translateX(-50%) translateY(120%);
        opacity: 0;
        visibility: hidden;
    }

    /* Ya no movemos el texto hacia arriba al hacer hover para evitar superposiciÃ³n */


    body {
        max-width: 100%; /* Ajuste del ancho mÃ¡ximo del body */
    }

    /* Logo configurable solo en escritorio/tablet, sin afectar mÃ³viles */
    .header-logo {
        width: var(--cloudshop-logo-width, 100px);
        height: var(--cloudshop-logo-height, 90px);
    }
}

@media (min-width: 1024px) {
    .product-item {
        width: calc(16.66% - 10px); /* Seis productos por fila para pantallas muy grandes */
    }
}

@media (min-width: 1440px) {
    .product-item {
        width: calc(14.28% - 10px); /* Siete productos por fila para pantallas extra grandes */
    }
}

@media (min-width: 1920px) {
    .product-item {
        width: calc(14.28% - 10px); /* Siete productos por fila para pantallas extra grandes */
    }
}



.total-items-round {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: transform 0.3s ease-in-out;
}




/* Estilos para la carga diferida */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-load-loaded {
    opacity: 1;
}

.image-placeholder {
    width: 100%;
    height: 0;
    padding-top: 100%; /* ProporciÃ³n 1:1 */
    background-color: #fff;
    position: relative;
    border-radius: 8px;    
    overflow: hidden;
}

.image-placeholder img {
    position: absolute;
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    object-fit: contain; /* Asegura que toda la imagen sea visible, sin recortes */
    object-position: center;
    display: block;
    transition: opacity 0.4s ease-in-out;
}
.placeholder-img {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0.035) 45%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
    background-size: 220% 100%, 100% 100%;
    animation: product-image-skeleton 1.2s ease-in-out infinite;
    transition: opacity 0.25s ease-in-out;
}

.placeholder-img.hidden {
    opacity: 0;
}

.product-image.lazy-load {
    opacity: 0; /* Oculta por defecto */
}

.product-image.lazy-load-loaded {
    opacity: 1; /* Se muestra al cargar */
}

@keyframes product-image-skeleton {
    0% {
        background-position: 160% 0, 0 0;
    }

    100% {
        background-position: -60% 0, 0 0;
    }
}


.load-more-indicator {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 12px 28px;
    color: #666;
    font-size: 0.92rem;
}

.load-more-indicator::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--color-purpura);
    animation: load-more-spin 0.8s linear infinite;
}

@keyframes load-more-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Estilos para el Skeleton Loader (reintroducido y mejorado) */
.skeleton-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin: 5px;
    padding: 10px;
    width: calc(50% - 10px);
    box-sizing: border-box;
    transform: translateZ(0); /* Promover a su propia capa de composiciÃ³n */
}

.skeleton-image {
    height: 120px;
    background: #f0f0f0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-text {
    height: 18px;
    background: #f0f0f0;
    margin-top: 10px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-text.short {
    width: 60%;
    height: 14px;
}

.shimmer-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Nuevos estilos para el modal de previsualizaciÃ³n de pedido "Premium" */
#orderPreviewModal .modal-content {
    padding: 0;
    overflow: hidden;
    background-color: #f9f9f9;
}

.modal-header-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.modal-back-arrow, .modal-close-preview {
    flex: 0 0 35px;
    font-size: 24px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.modal-total-bar {
    flex-grow: 1;
    text-align: center;
    background-color: #ff0;
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.4em;
    font-weight: bold;
}

#order-items-container {
    overflow-y: auto;
    padding: 15px;
}

#orderPreviewModal .confirm-button {
    border-radius: 0;
    width: 100%;
    margin: 0;
    padding: 15px;
    flex-shrink: 0;
    background-color: #28a745;
}

/* Unificar el botÃ³n de confirmar para las otras pantallas de checkout */
#paymentMethodsModal .confirm-button,
#clientDetailsModal .confirm-button {
    background-color: #28a745; /* Verde Consistente */
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 0;
    width: 100%;
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0; /* Evita que el botÃ³n se encoja */
}

/* Hover del botÃ³n confirmar en pantallas de checkout */
#paymentMethodsModal .confirm-button:hover,
#clientDetailsModal .confirm-button:hover {
    background-color: #218838; /* Verde mÃ¡s oscuro al pasar el mouse */
}


/* Estilos para el comportamiento del modal en mÃ³viles */
@media (max-width: 768px) {
    #orderPreviewModal {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding-top: 0;
        background-color: transparent;
    }

    #orderPreviewModal .modal-content,
    #paymentMethodsModal .modal-content,
    #clientDetailsModal .modal-content,
    #productModal .modal-content,
    #branchStockModal .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 0; /* Eliminar el padding que causa el desbordamiento */
        box-sizing: border-box; /* Buena prÃ¡ctica para evitar futuros problemas de tamaÃ±o */
        transform: translateX(-100%); /* Empieza fuera de la pantalla a la izquierda */
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
    }

    #orderPreviewModal.show .modal-content,
    #paymentMethodsModal.show .modal-content,
    #clientDetailsModal.show .modal-content,
    #productModal.show .modal-content,
    #branchStockModal.show .modal-content {
        transform: translateX(0);
    }
    
    .modal-close-preview { display: none; }
    .modal-back-arrow { display: block; }

    #order-items-container, #payment-options-container, #client-details-container {
        flex-grow: 1;
        overflow-y: auto;
        max-height: none;
        padding: 0 15px; /* Padding en el contenedor */
    }

    #orderPreviewModal .confirm-button, #paymentMethodsModal .confirm-button, #clientDetailsModal .confirm-button {
        flex-shrink: 0;
        position: sticky; /* Fijar al final del contenedor */
        bottom: 0; /* Pegar a la parte inferior */
    }

    .modal-header-standard {
        flex-shrink: 0; /* Asegura que la cabecera no se encoja */
        position: static; /* Anula el 'sticky' en mÃ³vil para un control flexbox mÃ¡s fiable */
    }

    /* Forzar a los contenedores de los modales a ser pantalla completa en mÃ³vil */
    #orderPreviewModal,
    #paymentMethodsModal,
    #clientDetailsModal,
    #productModal,
    #branchStockModal {
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        background-color: transparent; /* El fondo lo pone el .modal-content */
    }

    #branchStockModal .modal-content {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
    }
}

/* --- LAYOUT DE ESCRITORIO: PANTALLAS A LA DERECHA, SIN FULL OVERLAY --- */
@media (min-width: 769px) {
    /* Paneles tipo app a la derecha (checkout + detalle de producto + sucursales en escritorio) */
    #orderPreviewModal,
    #paymentMethodsModal,
    #clientDetailsModal,
    #productModal,
    #branchStockModal {
        padding-top: 0;
        background-color: rgba(0,0,0,0.45); /* Fondo semitransparente tipo app moderna */
        overflow: hidden; /* Evitar scroll doble, solo scrollea el contenido interno */
    }

    #orderPreviewModal .modal-content,
    #paymentMethodsModal .modal-content,
    #clientDetailsModal .modal-content,
    #productModal .modal-content,
    #branchStockModal .modal-content {
        width: 420px;
        max-width: 420px;
        height: 100vh;          /* ocupar todo el alto disponible */
        max-height: 100vh;      /* lÃ­mite duro: nunca mÃ¡s de la pantalla */
        margin: 0 0 0 auto;     /* pegado al top y bottom de la pantalla */
        border-radius: 0;       /* Sin bordes redondeados externos */
        box-shadow: 0 0 12px rgba(0,0,0,0.25);
        display: flex;
        flex-direction: column;
        transform: translateX(100%); /* Empieza fuera de la pantalla (derecha) */
        transition: transform 0.3s ease-in-out;
    }

    /* En escritorio, los paneles de detalle y sucursales ocupan todo el alto
       disponible y quedan pegados arriba y abajo dentro del viewport */
    #productModal .modal-content,
    #branchStockModal .modal-content {
        height: 100vh;
        max-height: 100vh;
        margin: 0 0 0 auto;
        border-radius: 0;
    }

    #orderPreviewModal.show .modal-content,
    #paymentMethodsModal.show .modal-content,
    #clientDetailsModal.show .modal-content,
    #productModal.show .modal-content,
    #branchStockModal.show .modal-content {
        transform: translateX(0); /* Entra deslizÃ¡ndose desde la derecha */
    }

    /* Contenido scrollable: ocupa todo entre header y botÃ³n (todos los pasos) */
    #order-items-container,
    #payment-options-container,
    #client-details-container {
        flex-grow: 1;
        overflow-y: auto;
        max-height: none;
        padding: 0 15px 10px; /* padding lateral + pequeÃ±o espacio sobre el botÃ³n */
    }

    /* Botones de confirmar siempre pegados al bottom del panel en escritorio */
    #orderPreviewModal .confirm-button,
    #paymentMethodsModal .confirm-button,
    #clientDetailsModal .confirm-button {
        margin-top: auto;   /* Empuja el botÃ³n al final del flex */
        border-radius: 0;   /* Sin curvas en la base del panel */
        flex-shrink: 0;
    }
}


/* --- REGLA AÃ‘ADIDA PARA CORREGIR BUG EN ESCRITORIO --- */
/* Asegura que el modal siempre sea visible en escritorio cuando tiene la clase .show */
.modal.show .modal-content {
    transform: translateX(0);
}


/* Clase para bloquear el scroll del body */
.scroll-lock {
    overflow: hidden;
}

.order-item .product-controls .quantity-handler {
    display: flex;
    flex-direction: column; /* Apila los botones verticalmente */
    align-items: center;
    gap: 5px;
}

.order-item .product-controls button {
    background-color: #007bff; /* Color azul para los botones */
    color: white;
    width: 32px;
    height: 32px;
    font-size: 1.4em;
    line-height: 32px; /* Centrar el sÃ­mbolo verticalmente */
}

.order-item .product-controls input {
    width: 45px;
    height: 35px;
    font-size: 1.2em;
    padding: 0;
}

.order-item-details {
    font-size: 0.8em; /* Reducir el tamaÃ±o de la fuente de los detalles */
    gap: 3px; /* PequeÃ±o ajuste en el espaciado */
}

.order-item-details strong {
    font-size: 1.05em; /* Ligeramente mÃ¡s grande para destacar */
    font-weight: 600;
    color: #000; /* Color negro para el nombre del producto */
    margin-bottom: 2px;
}

.order-item-details span {
    color: #666; /* Color gris para los detalles secundarios */
}

.payment-option {
    display: flex;
    align-items: flex-start;
    padding: 15px 0; /* Padding vertical en el item, horizontal en el contenedor */
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.payment-option:last-child {
    border-bottom: none;
}

.payment-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 5px;
}

.payment-option-details {
    flex-grow: 1;
    min-width: 0; /* Fuerza al contenedor a respetar los lÃ­mites y permite el word-wrap */
}

.payment-option-details h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.payment-option-details p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.payment-logos {
    margin-top: 10px;
}

.payment-logos img {
    height: 25px;
    margin-right: 10px;
}

/* Estilos para el Formulario de Datos del Cliente */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box; /* Corregir desbordamiento */
    font-size: 1em;
}

.modal-content * {
    box-sizing: border-box; /* Aplicar a todos los hijos para evitar desbordamiento */
}

.optional-label {
    font-weight: 400;
    color: #777;
    font-size: 0.9em;
}

/* VersiÃ³n mÃ¡s compacta del formulario SOLO para #client-details */
#clientDetailsModal .modal-title {
    font-size: 1em;
}

#clientDetailsModal .form-group {
    margin-bottom: 12px;
}

#clientDetailsModal .form-group label {
    margin-bottom: 4px;
    font-size: 0.95em;
}

#clientDetailsModal .form-group input[type="text"],
#clientDetailsModal .form-group input[type="tel"] {
    padding: 8px 10px;
    font-size: 0.95em;
}

#clientDetailsModal .optional-label,
#clientDetailsModal .location-status {
    font-size: 0.8em;
}

/* Grupo de telÃ©fono (cÃ³digo de paÃ­s + nÃºmero) */
.phone-input-group {
    display: flex;
    gap: 8px;
}

.phone-input-group select {
    padding: 8px 6px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9em;
    background-color: #fff;
}

.phone-input-group input[type="tel"] {
    flex: 1;
}

.phone-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.8em;
    color: #666;
}

/* BotÃ³n y preview de ubicaciÃ³n (tipo compartir ubicaciÃ³n de WhatsApp) */
.location-button {
    display: inline-block;
    margin-top: 6px;
    margin-bottom: 4px;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background-color: var(--color-purpura);
    color: #fff;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
}

.location-button:active {
    transform: scale(0.97);
}

.checkout-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-suggestion {
    display: grid;
    gap: 8px;
    margin: 2px 0 12px;
    padding: 9px;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    background: #eff6ff;
    color: #172033;
}

.client-suggestion[hidden] {
    display: none !important;
}

.client-suggestion-header {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.client-suggestion-header strong {
    font-size: 0.9em;
    font-weight: 700;
}

.client-suggestion-header span {
    color: #4b5563;
    font-size: 0.76em;
    line-height: 1.25;
}

.client-suggestion-list {
    display: grid;
    gap: 6px;
    max-height: 218px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.client-suggestion-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 8px 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #fff;
}

.client-suggestion-identity {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.client-suggestion-name {
    display: -webkit-box;
    overflow: hidden;
    color: #172033;
    font-size: 0.83em;
    font-weight: 700;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.client-suggestion-meta {
    display: -webkit-box;
    overflow: hidden;
    color: #64748b;
    font-size: 0.73em;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.apply-client-suggestion-btn {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 350px) {
    .client-suggestion-item {
        grid-template-columns: 1fr;
    }

    .apply-client-suggestion-btn {
        width: 100%;
    }
}

.secondary-inline-button {
    align-self: flex-start;
    background: #f3f4f6;
    color: #333;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.92em;
    font-weight: 600;
    cursor: pointer;
}

.secondary-inline-button:hover {
    background: #e5e7eb;
}

.location-status {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85em;
    color: #666;
}

.location-preview a {
    font-size: 0.9em;
    color: #007bff;
    text-decoration: underline;
}

/* Formulario de datos del cliente: botÃ³n pegado al bottom del panel */
#clientDetailsModal .modal-content {
    padding-bottom: 0;
}

#clientDetailsModal .confirm-button {
    margin-bottom: 0;
}

/* Nueva cabecera estÃ¡ndar para pantallas apiladas */
.modal-header-standard {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-header-standard .modal-title {
    flex-grow: 1;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    /* Truco para centrar el tÃ­tulo perfectamente con un botÃ³n a la izquierda */
    padding-right: 32px; /* Espacio igual al del botÃ³n de retroceso */
}

.modal-header-standard .modal-back-arrow {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    width: 32px; /* Ancho fijo para el cÃ¡lculo del centrado del tÃ­tulo */
}

/* --- ESTILOS PARA LAYOUT DE ESCRITORIO (SIDEBAR IZQUIERDA) --- */
@media (min-width: 769px) {
    #main-container {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }

    #category-container {
        flex: 0 0 220px; /* Ancho fijo para la sidebar de categorÃ­as */
        position: sticky;
        top: 20px; /* Se pega debajo del header */
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: calc(100vh - 40px); /* Altura mÃ¡xima para permitir scroll interno */
        padding: 10px;
        background-color: #f9f9f9;
        border-radius: 8px;
        border: 1px solid #eee;
    }

    .category-button {
        width: 100%;
        margin: 5px 0;
        justify-content: flex-start; /* Alinea el texto a la izquierda */
        padding: 12px 15px;
        white-space: normal; /* Permite que el texto se ajuste */
        text-align: left;
    }

    #product-area {
        flex: 1; /* Ocupa el resto del espacio */
        min-width: 0; /* SoluciÃ³n para problemas de overflow en flexbox */
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        padding: 0; /* El padding se maneja en #product-area si es necesario */
    }

    .header-content .search-container {
        flex-grow: 1;
        margin: 0 20px;
    }

    .advanced-filter-bar .search-group {
        flex-grow: 1;
        background-color: white;
        border-radius: 20px;
        padding: 0 12px;
        display: flex;
        align-items: center;
    }

    .advanced-filter-bar .search-input {
        border: none;
        outline: none;
        padding: 10px 5px;
        width: 100%;
        font-size: 0.95em;
        background: transparent;
    }
    
    .price-group input[type="number"] {
        width: 80px;
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 5px;
        text-align: right;
    }
    
    .price-group span {
        color: white;
    }

    .sort-group .sort-options-desktop {
        display: flex;
        gap: 15px;
    }

    .sort-options-desktop label {
        display: flex;
        align-items: center;
        gap: 5px;
        font-weight: normal;
        cursor: pointer;
        color: white;
        font-size: 0.85em;
    }

    .sort-options-desktop input[type="radio"] {
        accent-color: #fff;
    }
}

/* LÃ³gica de visibilidad y estilo del botÃ³n Refinar (AHORA GLOBAL) */
.refine-trigger-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    color: #555;
    font-size: 1.1em;
}

.refine-trigger-button:hover {
    color: var(--theme-color, #4B0082);
}

/* --- ESTILOS PARA EL PANEL LATERAL DE FILTROS --- */
.refine-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.refine-sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.refine-header {
    display: none; /* Ocultado segÃºn solicitud */
}

.refine-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.refine-header .close-refine {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.refine-body {
    padding: 12px; /* Menos padding para aprovechar mejor la altura */
    overflow-y: auto;
    flex-grow: 1;
}

.refine-group {
    margin-bottom: 18px;
}

.refine-group:last-child {
    margin-bottom: 0;
}

.refine-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1em;
    /* text-transform: uppercase; */
    color: #333;
    font-weight: 600;
}

.toggle-switch {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.toggle-switch .toggle-option {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.9em;
}

.toggle-switch .toggle-option.active {
    background: var(--theme-color, #4B0082);
    color: white;
    font-weight: bold;
}

.toggle-switch .toggle-option:first-child {
    border-right: 1px solid #ccc;
}

.price-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-inputs::before, .price-inputs::after {
    content: 'Gs.';
    color: #555;
}

.price-inputs input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: right;
}

.sort-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-options li {
    margin-bottom: 12px;
}

.sort-options li:last-child {
    margin-bottom: 0;
}

.sort-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sort-options input[type="radio"] {
    accent-color: var(--theme-color, #4B0082);
    width: 18px;
    height: 18px;
}

.category-options {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: none;        /* Permitir que crezca mÃ¡s */
    overflow-y: visible;     /* El scroll queda en el sidebar, no en este bloque */
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 4px;
}

/* BotÃ³n flotante de CATEGORÃAS para mÃ³viles (lado izquierdo) */
.mobile-categories-button {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--degradado-purpura);
    color: #fff;
    border: none;
    border-radius: 0 12px 12px 0;
    padding: 12px 6px;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    cursor: pointer;
    z-index: 1200;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    display: none; /* solo mÃ³vil */
}

@media (max-width: 768px) {
    .mobile-categories-button {
        display: block;
    }
}

/* La pestaÃ±a lateral pertenece solo al catÃ¡logo principal. */
body.product-detail-open .mobile-categories-button,
body.catalog-secondary-screen-open .mobile-categories-button {
    display: none;
}

.category-options li {
    margin-bottom: 1px; /* Menos espacio entre categorÃ­as */
}

.category-options label {
    display: block;
    padding: 4px 10px; /* MÃ¡s compacto verticalmente */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.85em; /* Un poco mÃ¡s chico para mostrar mÃ¡s filas */
}

.category-options label:hover {
    background-color: #f5f5f5;
}

.category-options input[type="radio"] {
    margin-right: 8px;
}

/* --- Pantalla de Pedido Exitoso --- */
.order-success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 3000;
    display: none; /* Oculto por defecto */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.order-success-screen.visible {
    display: flex;
}

.order-success-screen .success-icon {
    color: #28a745;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.order-success-screen h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.order-success-screen p {
    font-size: 1.1em;
    margin-bottom: 25px;
    color: #555;
}

.order-success-screen .success-order-info {
    display: none;
    margin: -8px 0 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f3f3f3;
    color: #222;
    font-size: 1em;
    font-weight: 600;
}

.order-success-screen .success-order-info.visible {
    display: inline-block;
}

.close-success-button {
    background-color: var(--theme-color, #4B0082);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
}

/* --- Smart Install Prompt (PWA) --- */
.pwa-install-prompt {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3100;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pwa-install-prompt.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pwa-install-sheet {
    position: relative;
    width: min(700px, calc(100vw - 20px));
    margin: 0 auto 12px;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    padding: 16px 16px 14px;
    box-sizing: border-box;
}

.pwa-install-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
}

.pwa-install-content h3 {
    margin: 0 28px 6px 0;
    font-size: 1.1em;
    color: #202020;
}

.pwa-install-subtitle {
    margin: 0 0 6px;
    color: #343434;
    font-size: 0.95em;
}

.pwa-install-note {
    margin: 0;
    color: #6b6b6b;
    font-size: 0.83em;
}

.pwa-install-steps {
    margin: 8px 0 0 20px;
    padding: 0;
    color: #2f2f2f;
    font-size: 0.9em;
    display: none;
}

.pwa-install-steps.visible {
    display: block;
}

.pwa-install-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pwa-install-btn {
    border-radius: 999px;
    border: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: #333;
    font-weight: 600;
    font-size: 0.9em;
    padding: 9px 14px;
    cursor: pointer;
}

.pwa-install-btn-primary {
    background: var(--theme-color, #4B0082);
    border-color: var(--theme-color, #4B0082);
    color: #fff;
}

.pwa-install-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .pwa-install-sheet {
        width: calc(100vw - 10px);
        margin-bottom: 8px;
        border-radius: 16px;
        padding: 14px 12px 12px;
    }

    .pwa-install-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pwa-install-btn {
        width: 100%;
    }
}

/* BotÃ³n flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px; /* PosiciÃ³n inicial mÃ¡s abajo */
    left: 20px;
    z-index: 1001;
    animation: pulse-whatsapp 2s infinite;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    border-radius: 50%;
    transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out; /* TransiciÃ³n suave */
    opacity: 0;
    visibility: hidden;
}

.whatsapp-float.visible {
    opacity: 1;
    visibility: visible;
}

.whatsapp-float img {
    width: 100%;
    height: 100%;
}

@keyframes pulse-whatsapp {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(0.95);
    }
}


/* --- ESTILOS DEFINITIVOS PARA LAYOUT DE ESCRITORIO --- */
@media (min-width: 1024px) {
    .header-content {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
    }

    .header-content .search-container,
    .cloudshop-logo-height-expanded .header-content .search-container {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 40px;
        margin: 0;
        box-sizing: border-box;
    }

    .header-content .search-input {
        min-width: 0;
        font-size: 14px;
    }

    .desktop-filters {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
        margin-left: 12px;
    }

    .desktop-filters .filter-group {
        flex: 0 0 auto;
        gap: 6px;
    }

    .desktop-filters .filter-group > label {
        font-size: 12px;
    }

    .desktop-filters .stock-filter-group .catalog-filter-select {
        width: 112px;
    }

    .desktop-filters .sort-group .catalog-filter-select {
        width: 124px;
    }

    .desktop-filters .cart-header {
        flex: 0 0 auto;
        margin: 0 6px 0 0;
    }

    .catalog-records-counter {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        min-height: 28px;
        padding: 3px 7px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.1);
        line-height: 1;
    }

    .catalog-records-label {
        color: rgba(255, 255, 255, 0.72);
        font-size: 8px;
        font-weight: 700;
    }

    .catalog-records-value {
        display: inline-flex;
        align-items: baseline;
        justify-content: center;
        gap: 1px;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        white-space: nowrap;
    }

    .catalog-records-value strong {
        font-size: 11px;
        font-weight: 800;
    }

    .filter-group {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .filter-group > label {
        white-space: nowrap;
        font-weight: 500;
        color: white;
        font-size: 0.9em;
    }
    
    .price-group input[type="number"] {
        box-sizing: border-box;
        width: 72px;
        height: 34px;
        padding: 6px;
        font-size: 12px;
        border: 1px solid #ddd;
        border-radius: 5px;
        text-align: right;
    }
    
    .price-group span {
        color: white;
    }

    .sort-group .sort-options-desktop {
        display: flex;
        gap: 15px;
    }

    .sort-options-desktop label {
        display: flex;
        align-items: center;
        gap: 5px;
        font-weight: normal;
        cursor: pointer;
        color: white;
        font-size: 0.85em;
    }

    .sort-options-desktop input[type="radio"] {
        accent-color: #fff;
    }
}

/* Keep the filters together when the tablet header needs a second row. */
@media (min-width: 1024px) and (max-width: 1279px) {
    .header-content {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .desktop-filters {
        flex-basis: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (min-width: 1600px) {
    .desktop-filters {
        gap: 12px;
    }

    .desktop-filters .filter-group > label {
        font-size: 14px;
    }

    .desktop-filters .price-group input[type="number"] {
        width: 90px;
    }

    .desktop-filters .stock-filter-group .catalog-filter-select {
        width: 160px;
    }

    .desktop-filters .sort-group .catalog-filter-select {
        width: 178px;
    }
}



/* Banner Slider Styles */
.banner-slider {
    width: 100%;
    margin-top: 0;
    margin-bottom: 8px;
    display: block !important; /* FORZAR VISIBILIDAD */
}

.swiper {
    width: 100%;
    height: auto;
}

.swiper:not(.swiper-initialized) .swiper-slide:not(:first-child),
.swiper:not(.swiper-initialized) .swiper-button-prev,
.swiper:not(.swiper-initialized) .swiper-button-next,
.swiper:not(.swiper-initialized) .swiper-pagination {
    display: none;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Banner sizing is shared by all viewports below. */

.swiper-button-next,
.swiper-button-prev {
    color: #fff !important;
    background-color: rgba(0, 0, 0, 0.4);
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px !important;
    font-weight: bold;
}

.swiper-pagination-bullet {
    background: white !important;
    opacity: 0.7 !important;
}

.swiper-pagination-bullet-active {
    background: #ff0000 !important;
    opacity: 1 !important;
}

@media (max-width: 767px) {
    html,
    body,
    #main-content {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header {
        padding: 6px 6px 7px;
        align-items: stretch;
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .header-logo-link {
        width: auto;
        height: 48px;
        margin-left: 2px;
        flex: 0 0 auto;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
    }

    .header-logo {
        width: auto;
        /* The editor preview sets inline limits; keep the same mobile logo cap. */
        max-width: clamp(92px, 31vw, 122px) !important;
        height: 48px;
        margin: 0;
        object-fit: contain;
        object-position: left center;
        border-radius: 8px;
    }

    .search-container {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        height: 40px;
        margin: 0 2px 0 0;
        padding-left: 2px;
        border-radius: 22px;
        box-sizing: border-box;
    }

    .refine-trigger-button {
        width: 36px;
        min-width: 36px;
        padding: 0;
    }

    .search-input {
        min-width: 0;
        padding: 9px 4px;
        font-size: 0.95em;
    }

    .search-icon {
        padding: 0 10px 0 5px;
    }

    .product-list {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        justify-content: flex-start;
    }

    .product-item {
        flex: 0 0 calc(50% - 6px);
        width: calc(50% - 6px);
        min-width: 0;
        margin: 3px;
    }

    .product-branch-availability,
    .add-to-cart {
        min-width: 0;
        max-width: calc(100% - 12px);
    }

    .product-branch-availability span,
    .add-to-cart span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

}

/* Let the actual available space decide where each desktop control fits. */
@media (min-width:1024px) {
    .header-content {
        flex-wrap:wrap;
        justify-content:flex-start;
        gap:6px;
        min-width:0;
    }
    .header-content .search-container,
    .cloudshop-logo-height-expanded .header-content .search-container {
        flex:1 1 180px;
        min-width:180px;
        width:auto;
        max-width:none;
        margin:0;
    }
    .header-content .desktop-filters {
        display:contents;
    }
    .desktop-filters .filter-group {
        display:inline-flex;
        flex:0 0 auto;
        align-items:center;
        white-space:nowrap;
    }
    .desktop-filters .header-result-actions {
        display:flex;
        flex:0 0 auto;
        flex-wrap:nowrap;
        align-items:center;
        gap:6px;
    }
    .desktop-filters .catalog-records-counter,
    .desktop-filters .cart-header {
        flex:0 0 auto;
        align-self:center;
    }
}
@media (min-width:1024px) and (max-width:1599px) {
    .desktop-filters .filter-group {gap:4px}
    .desktop-filters .stock-filter-group .catalog-filter-select {width:106px}
    .desktop-filters .sort-group .catalog-filter-select {width:120px}
}

/* Shared responsive storefront: preserve artwork and useful catalog space. */
.banner-slider{height:auto!important;min-height:0;margin-bottom:8px!important}
.banner-slider .swiper,.banner-slider .swiper-slide,.banner-slider .cloudshop-banner-link{height:auto!important;min-height:0}
.banner-slider .swiper-wrapper{height:auto;align-items:flex-start}
.banner-slider .swiper-slide{background:var(--degradado-purpura);align-items:flex-start}
.banner-slider .swiper-slide img{display:block;width:100%;height:auto!important;max-height:min(52vh,560px);max-height:min(52dvh,560px);object-fit:contain!important}
@media(max-height:540px) and (orientation:landscape){.banner-slider .swiper-slide img{max-height:42vh;max-height:42dvh}}
@media(min-width:768px) and (max-width:1023px){.header-content{column-gap:10px}.header-content .search-container,.cloudshop-logo-height-expanded .header-content .search-container{flex:1 1 0;width:auto;min-width:0;max-width:none;margin:0;height:40px}}
/* Keep the original mobile catalog layout; fitting applies on desktop only. */
@media(min-width:1024px){
#productList.product-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,max(170px,calc((100% - 36px)/7))),1fr));gap:6px;justify-content:initial;width:100%;max-width:1960px;min-width:0;margin:10px auto 0;padding:6px 6px 90px;box-sizing:border-box}
#productList>.product-item,#productList>.skeleton-item{width:auto;min-width:0;margin:0;flex:none}
#productList>.empty-state{grid-column:1/-1}
#csfHome{max-width:1960px}
.product-item .product-name{word-break:normal;overflow-wrap:anywhere}

}
.cart-footer{padding-bottom:calc(7px + env(safe-area-inset-bottom,0px))}
#orderPreviewModal.show,#paymentMethodsModal.show,#clientDetailsModal.show,#productModal.show,#branchStockModal.show{top:var(--cs-visual-top,0px);height:var(--cs-usable-height,100dvh)}
#orderPreviewModal.show .modal-content,#paymentMethodsModal.show .modal-content,#clientDetailsModal.show .modal-content,#productModal.show .modal-content,#branchStockModal.show .modal-content{height:100%;max-height:100%;min-height:0;max-width:100vw}
#order-items-container,#payment-options-container,#client-details-container{min-height:0;overscroll-behavior:contain;scroll-padding:16px}
#orderPreviewModal .confirm-button,#paymentMethodsModal .confirm-button,#clientDetailsModal .confirm-button{min-height:48px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));white-space:normal}


/* Preserve the original desktop storefront; constrained artwork belongs to touch/mobile layouts. */
@media (min-width:1024px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider {
  height:max(1px,calc(100vh - var(--cloudshop-header-offset,105px) - var(--cloudshop-banner-footer-height,0px)))!important;
  height:max(1px,calc(100dvh - var(--cloudshop-header-offset,105px) - var(--cloudshop-banner-footer-height,0px)))!important;
  margin-bottom:0!important;
  background:var(--degradado-purpura);
 }
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .swiper,
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .swiper-wrapper,
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .swiper-slide,
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .cloudshop-banner-link {
  height:100%!important;min-height:0;
 }
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .swiper-slide {background:transparent}
 html:not(.cloudshop-touch-preview) body:not(.catalog-filter-results) .banner-slider .swiper-slide img {
  width:100%;height:100%!important;max-height:none!important;object-fit:fill!important;
 }
}
