/* =========================================
   TIENDA VIRTUAL - MUEBLES BELLEZA
   ========================================= */

/* --- Layout principal --- */
.tienda-main {
    display: flex;
    min-height: calc(100vh - 140px);
    max-width: 1400px;
    margin: 1.5rem auto;
    gap: 0;
    padding: 0 1rem;
    position: relative;
}

/* --- Sidebar --- */
.tienda-sidebar {
    width: 260px;
    min-width: 220px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px #1a237e11;
    padding: 1.5rem 1rem;
    height: fit-content;
    position: sticky;
    top: 1.5rem;
    flex-shrink: 0;
    margin-right: 1.5rem;
    border: 1px solid #e7eaf6;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0f0f0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1a237e;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-cerrar-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.btn-cerrar-sidebar:hover {
    background: #f0f0f0;
    color: #d930a7;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

.sidebar-categorias {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-categorias li {
    width: 100%;
}

.cat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.98rem;
    color: #3d2c29;
    text-align: left;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
}

.cat-btn:hover {
    background: #f0f4ff;
    color: #1a237e;
}

.cat-btn.activo {
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    font-weight: bold;
}

.cat-icon {
    font-size: 1.2rem;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.cat-foto {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

/* --- Contenido tienda --- */
.tienda-contenido {
    flex: 1;
    min-width: 0;
}

/* --- Toolbar --- */
.tienda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px #1a237e0d;
    border: 1px solid #e7eaf6;
    flex-wrap: wrap;
}

.toolbar-izq {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-der {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-filtros-movil {
    display: none;
    background: #1a237e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-filtros-movil:hover {
    background: #d930a7;
}

.tienda-titulo-seccion {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a237e;
    letter-spacing: 0.5px;
}

.productos-count {
    color: #888;
    font-size: 0.95rem;
}

.select-orden {
    padding: 0.5rem 1rem;
    border: 1.5px solid #e7eaf6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #3d2c29;
    cursor: pointer;
    background: #fff;
    outline: none;
    transition: border 0.2s;
}

.select-orden:hover, .select-orden:focus {
    border-color: #1a237e;
}

/* --- Loading y estados --- */
.tienda-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: #888;
    font-size: 1.1rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e7eaf6;
    border-top: 4px solid #1a237e;
    border-right: 4px solid #d930a7;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tienda-error {
    text-align: center;
    padding: 3rem;
    background: #fff3f3;
    border-radius: 14px;
    color: #c00;
}

.tienda-error button {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: #1a237e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.sin-resultados {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.1rem;
}

.sin-resultados button {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(90deg, #1a237e, #d930a7);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: opacity 0.2s;
}

.sin-resultados button:hover {
    opacity: 0.88;
}

/* --- Grid de productos --- */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* --- Tarjeta de producto --- */
.producto-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 3px 16px #1a237e11;
    border: 1.5px solid #e7eaf6;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s, box-shadow 0.22s, border 0.22s;
    cursor: pointer;
    position: relative;
}

.producto-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 10px 36px #d930a730;
    border-color: #d930a7;
}

.producto-card-img {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.producto-card:hover .producto-card-img img {
    transform: scale(1.06);
}

.producto-img-placeholder {
    font-size: 3.5rem;
    color: #ccc;
}

.badge-descuento {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(90deg, #d930a7, #ff5e9e);
    color: #fff;
    font-size: 0.78rem;
    font-weight: bold;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px #d930a744;
    letter-spacing: 0.5px;
    z-index: 1;
}

.badge-sin-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.22rem 0.55rem;
    border-radius: 20px;
    z-index: 1;
}

.producto-card-body {
    padding: 1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-seccion-label {
    font-size: 0.75rem;
    color: #d930a7;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.3rem;
}

.producto-card-nombre {
    font-size: 1rem;
    font-weight: bold;
    color: #1a237e;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-card-desc {
    font-size: 0.88rem;
    color: #777;
    margin: 0 0 0.7rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.producto-card-precio {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.precio-final {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a237e;
}

.precio-original {
    font-size: 0.9rem;
    color: #bbb;
    text-decoration: line-through;
}

.precio-descuento-pct {
    font-size: 0.78rem;
    background: #fff0f8;
    color: #d930a7;
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-weight: bold;
}

.producto-card-footer {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-agregar {
    flex: 1;
    padding: 0.6rem 0;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
}

.btn-agregar:hover {
    opacity: 0.88;
    transform: scale(1.03);
}

.btn-agregar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

.btn-ver-detalle {
    padding: 0.6rem 0.8rem;
    background: #f0f4ff;
    color: #1a237e;
    border: 1.5px solid #1a237e22;
    border-radius: 9px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
}

.btn-ver-detalle:hover {
    background: #e0e8ff;
    border-color: #1a237e;
}

/* --- Paginación --- */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0 2rem 0;
    flex-wrap: wrap;
}

.pag-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid #e7eaf6;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1a237e;
    transition: all 0.18s;
    min-width: 40px;
}

.pag-btn:hover {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}

.pag-btn.activo {
    background: linear-gradient(90deg, #1a237e, #d930a7);
    color: #fff;
    border-color: transparent;
    font-weight: bold;
}

.pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =========================================
   CARRITO PANEL
   ========================================= */
.carrito-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

.carrito-overlay.activo {
    display: block;
}

.carrito-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 96vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 32px #1a237e22;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
}

.carrito-panel.abierto {
    transform: translateX(0);
}

.carrito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
}

.carrito-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.btn-cerrar-carrito {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-cerrar-carrito:hover {
    background: rgba(255,255,255,0.35);
}

.carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.carrito-vacio {
    text-align: center;
    color: #aaa;
    font-size: 1.05rem;
    padding: 2rem;
}

.carrito-item {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.9rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.carrito-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.carrito-item-info {
    flex: 1;
    min-width: 0;
}

.carrito-item-nombre {
    font-size: 0.92rem;
    font-weight: bold;
    color: #1a237e;
    margin: 0 0 0.3rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carrito-item-precio {
    font-size: 0.95rem;
    color: #d930a7;
    font-weight: bold;
}

.carrito-item-controles {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.carrito-item-controles button {
    width: 26px;
    height: 26px;
    border: 1.5px solid #e7eaf6;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    font-family: inherit;
    color: #1a237e;
}

.carrito-item-controles button:hover {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}

.carrito-item-controles .btn-eliminar {
    color: #d930a7;
    border-color: #f0d0e8;
}

.carrito-item-controles .btn-eliminar:hover {
    background: #d930a7;
    color: #fff;
    border-color: #d930a7;
}

.carrito-item-cantidad {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.carrito-footer {
    padding: 1rem 1.2rem 1.5rem 1.2rem;
    border-top: 2px solid #f0f0f0;
    background: #fafbff;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.carrito-subtotal-row,
.carrito-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.carrito-total-row {
    font-size: 1.1rem;
    color: #1a237e;
}

.carrito-domicilio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    gap: 0.5rem;
}

.carrito-domicilio-row input {
    width: 100px;
    padding: 0.35rem 0.7rem;
    border: 1.5px solid #e7eaf6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    text-align: right;
    transition: border 0.2s;
}

.carrito-domicilio-row input:focus {
    border-color: #1a237e;
}

.carrito-botones {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.3rem;
}

.btn-vaciar {
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    background: #f5f5f5;
    color: #888;
    border: 1.5px solid #e7eaf6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.93rem;
    font-family: inherit;
    transition: all 0.18s;
}

.btn-vaciar:hover {
    background: #ffe0e0;
    color: #c00;
    border-color: #ffaaaa;
}

.btn-checkout {
    flex: 1;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
}

.btn-checkout:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

/* =========================================
   MODAL CHECKOUT
   ========================================= */
.checkout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 299;
}

.checkout-overlay.activo {
    display: block;
}

.checkout-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(900px, 96vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 64px #1a237e44;
    z-index: 300;
    overflow: hidden;
    transition: transform 0.25s, opacity 0.25s;
    opacity: 0;
    display: none;
    flex-direction: column;
}

.checkout-modal.abierto {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3rem 2rem;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    flex-shrink: 0;
}

.checkout-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.btn-cerrar-checkout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-cerrar-checkout:hover {
    background: rgba(255,255,255,0.35);
}

.checkout-body {
    display: flex;
    gap: 2rem;
    padding: 1.8rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.checkout-col {
    flex: 1;
    min-width: 0;
}

.checkout-col h3 {
    font-size: 1.05rem;
    font-weight: bold;
    color: #1a237e;
    margin: 0 0 1.1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    letter-spacing: 0.3px;
}

.checkout-buscar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkout-buscar input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #e7eaf6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

.checkout-buscar input:focus {
    border-color: #1a237e;
}

.checkout-buscar button {
    padding: 0.6rem 1.1rem;
    background: #1a237e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}

.checkout-buscar button:hover {
    background: #d930a7;
}

.cliente-encontrado {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding: 0.8rem;
    background: #f0fff4;
    border: 1.5px solid #a0e0b0;
    border-radius: 10px;
    font-size: 0.93rem;
    margin-bottom: 1rem;
}

.btn-usar-cliente {
    padding: 0.35rem 0.9rem;
    background: #1a8a4a;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-usar-cliente:hover {
    background: #14703c;
}

.form-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    flex: 1;
    min-width: 0;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e7eaf6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    background: #fafbff;
    color: #3d2c29;
    transition: border 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1a237e;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Resumen del pedido en checkout */
.checkout-items-lista {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.3rem;
}

.checkout-item-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.92rem;
}

.checkout-item-img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 7px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.checkout-item-nombre {
    flex: 1;
    color: #333;
    font-weight: 500;
}

.checkout-item-subtotal {
    font-weight: bold;
    color: #1a237e;
    white-space: nowrap;
}

.checkout-totales {
    background: #fafbff;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid #e7eaf6;
}

.checkout-total-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.98rem;
    color: #555;
}

.checkout-total-fila.total-final {
    font-size: 1.1rem;
    color: #1a237e;
    padding-top: 0.5rem;
    border-top: 1.5px solid #e7eaf6;
    margin-top: 0.2rem;
}

.checkout-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.2rem 2rem;
    border-top: 2px solid #f0f0f0;
    background: #fafbff;
    flex-shrink: 0;
}

.btn-cancelar {
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    color: #888;
    border: 1.5px solid #e7eaf6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.18s;
}

.btn-cancelar:hover {
    background: #eee;
    color: #555;
}

.btn-confirmar {
    padding: 0.8rem 2.2rem;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.3px;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-confirmar:hover:not(:disabled) {
    opacity: 0.88;
    transform: scale(1.02);
}

.btn-confirmar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* =========================================
   MODAL DETALLE PRODUCTO
   ========================================= */
.detalle-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 249;
}

.detalle-overlay.activo {
    display: block;
}

.detalle-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, 96vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 64px #1a237e33;
    z-index: 250;
    overflow: hidden;
}

.detalle-content {
    display: flex;
    gap: 0;
    height: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.detalle-btn-cerrar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #0002;
    z-index: 10;
    transition: background 0.2s;
}

.detalle-btn-cerrar:hover {
    background: #d930a7;
    color: #fff;
}

.detalle-imagen {
    width: 320px;
    min-width: 260px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detalle-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 300px;
}

.detalle-info {
    padding: 2rem 1.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
}

.detalle-seccion {
    font-size: 0.8rem;
    color: #d930a7;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detalle-nombre {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a237e;
    margin: 0;
    line-height: 1.25;
}

.detalle-precio-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.detalle-precio-final {
    font-size: 1.6rem;
    font-weight: bold;
    color: #1a237e;
}

.detalle-precio-original {
    font-size: 1.1rem;
    color: #bbb;
    text-decoration: line-through;
}

.detalle-desc {
    font-size: 0.98rem;
    color: #555;
    line-height: 1.6;
    flex: 1;
}

.detalle-stock {
    font-size: 0.9rem;
    color: #777;
}

.detalle-stock.ok { color: #1a8a4a; }
.detalle-stock.agotado { color: #c00; }

.detalle-cantidad-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.detalle-cantidad-row label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.detalle-cantidad-row input {
    width: 70px;
    padding: 0.5rem 0.7rem;
    border: 1.5px solid #e7eaf6;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    outline: none;
}

.detalle-cantidad-row input:focus {
    border-color: #1a237e;
}

.btn-detalle-agregar {
    padding: 0.75rem 1.8rem;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
    align-self: flex-start;
    margin-top: 0.5rem;
}

.btn-detalle-agregar:hover:not(:disabled) {
    opacity: 0.88;
}

.btn-detalle-agregar:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========================================
   MODAL ÉXITO
   ========================================= */
.exito-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 399;
}

.exito-overlay.activo {
    display: block;
}

.exito-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 94vw);
    z-index: 400;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 64px #1a237e44;
    overflow: hidden;
}

.exito-content {
    padding: 3rem 2rem 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.exito-icono {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.exito-content h2 {
    font-size: 1.5rem;
    color: #1a237e;
    margin: 0;
}

.exito-content p {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

.btn-exito {
    margin-top: 1rem;
    padding: 0.8rem 2.2rem;
    background: linear-gradient(90deg, #1a237e 0%, #d930a7 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.btn-exito:hover {
    opacity: 0.88;
}

/* =========================================
   TOAST / NOTIFICACIÓN
   ========================================= */
.tienda-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(90deg, #1a237e, #d930a7);
    color: #fff;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 6px 24px #1a237e44;
    z-index: 500;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s;
    opacity: 0;
    white-space: nowrap;
    max-width: 90vw;
}

.tienda-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .tienda-main {
        flex-direction: column;
        margin: 1rem auto;
    }

    .tienda-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        border-radius: 0 18px 18px 0;
        transform: translateX(-100%);
        overflow-y: auto;
        margin-right: 0;
    }

    .tienda-sidebar.abierto {
        transform: translateX(0);
    }

    .sidebar-overlay.activo {
        display: block;
    }

    .btn-cerrar-sidebar {
        display: flex;
    }

    .btn-filtros-movil {
        display: block;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 1rem;
    }

    .checkout-body {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.2rem 1.2rem;
    }

    .detalle-content {
        flex-direction: column;
    }

    .detalle-imagen {
        width: 100%;
        height: 240px;
    }

    .detalle-imagen img {
        min-height: 200px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 600px) {
    .tienda-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-der {
        width: 100%;
        justify-content: space-between;
    }

    .select-orden {
        flex: 1;
    }

    .carrito-panel {
        width: 100vw;
    }

    .checkout-actions {
        flex-direction: column;
        gap: 0.7rem;
        padding: 1rem 1.2rem;
    }

    .btn-cancelar, .btn-confirmar {
        width: 100%;
        text-align: center;
    }
}
