/* ── DSS WooCommerce Custom – Frontend Mini-Cart ── */

/* ── Variables ── */
#dss-woo-minicart {
    --dss-woo-accent:   #2271b1;
    --dss-woo-accent-dk:#135e96;
    --dss-woo-shadow:   0 8px 32px rgba(0, 0, 0, 0.18);
    --dss-woo-radius:   16px;
    --dss-woo-panel-w:  340px;
}

/* ── Container ── */
.dss-woo-minicart {
    position: fixed !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    pointer-events: none !important;
    /* Panel aparece arriba del toggle en posiciones bottom */
    align-items: flex-end !important;
}

/* Positions */
.dss-woo-pos--bottom-right { bottom: 28px !important; right: 28px !important; align-items: flex-end !important; }
.dss-woo-pos--bottom-left  { bottom: 28px !important; left:  28px !important; align-items: flex-start !important; }
.dss-woo-pos--top-right    { top: 100px !important;   right: 28px !important; align-items: flex-end !important; }
.dss-woo-pos--top-left     { top: 100px !important;   left:  28px !important; align-items: flex-start !important; }

/* Toggle al final (visualmente abajo) en posiciones bottom */
.dss-woo-pos--bottom-right .dss-woo-toggle,
.dss-woo-pos--bottom-left  .dss-woo-toggle { order: 2; }
.dss-woo-pos--bottom-right .dss-woo-panel,
.dss-woo-pos--bottom-left  .dss-woo-panel  { order: 1; }

/* Toggle al principio (visualmente arriba) en posiciones top */
.dss-woo-pos--top-right .dss-woo-toggle,
.dss-woo-pos--top-left  .dss-woo-toggle { order: 1; }
.dss-woo-pos--top-right .dss-woo-panel,
.dss-woo-pos--top-left  .dss-woo-panel  { order: 2; }

/* ─────────────────────────────────────────────────────────────────────────
   BOTÓN FLOTANTE
   Reset completo contra estilos de temas WooCommerce/WordPress
   ───────────────────────────────────────────────────────────────────────── */
.dss-woo-toggle,
.dss-woo-toggle:not(.wp-block-button__link) {
    /* Reset de tema — CRÍTICO */
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    text-decoration: none !important;
    font-size: inherit !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;

    /* CRÍTICO para que el badge sea visible */
    overflow: visible !important;

    /* Forma y tamaño */
    pointer-events: all !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width:  56px !important;
    height: 56px !important;
    min-width:  56px !important;
    min-height: 56px !important;
    max-width:  56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    background: var(--dss-woo-accent) !important;
    color: #fff !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1),
                background .2s,
                box-shadow .2s !important;
}

.dss-woo-toggle:hover {
    background: var(--dss-woo-accent-dk) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32) !important;
}

.dss-woo-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.5),
                0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

/* Iconos dentro del botón */
.dss-woo-icon-cart,
.dss-woo-icon-close {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: block !important;
    pointer-events: none !important;
    transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dss-woo-icon-close {
    opacity: 0 !important;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.7) !important;
}

.dss-woo-toggle[aria-expanded="true"] .dss-woo-icon-cart {
    opacity: 0 !important;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.7) !important;
}

.dss-woo-toggle[aria-expanded="true"] .dss-woo-icon-close {
    opacity: 1 !important;
    transform: translate(-50%, -50%) rotate(0deg) scale(1) !important;
}

/* ── Badge ── */
.dss-woo-badge {
    /* Fuera del flujo del botón pero visible */
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    z-index: 1 !important;

    background: #dc2626 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    min-width: 20px !important;
    height: 20px !important;
    border-radius: 10px !important;
    padding: 0 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #fff !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s !important;
    /* Evita que el tema aplique estilos de badge/pill propios */
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
    box-shadow: none !important;
}

.dss-woo-badge--hidden {
    opacity: 0 !important;
    transform: scale(0) !important;
    pointer-events: none !important;
}

/* ── Panel ── */
.dss-woo-panel {
    pointer-events: all;
    width: var(--dss-woo-panel-w);
    max-height: 70vh;
    background: #fff;
    border-radius: var(--dss-woo-radius);
    box-shadow: var(--dss-woo-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(8px);
    opacity: 0;
    transition: opacity .25s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
    transform-origin: bottom right;
    box-sizing: border-box;
}

.dss-woo-pos--bottom-left .dss-woo-panel,
.dss-woo-pos--top-left    .dss-woo-panel { transform-origin: bottom left; }
.dss-woo-pos--top-right   .dss-woo-panel { transform-origin: top right; }
.dss-woo-pos--top-left    .dss-woo-panel { transform-origin: top left; }

.dss-woo-panel:not([hidden]) {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Panel Header */
.dss-woo-panel__header {
    background: var(--dss-woo-accent);
    color: #fff;
    padding: 16px 18px;
    flex-shrink: 0;
}

.dss-woo-panel__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

/* Panel Body */
.dss-woo-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scroll-behavior: smooth;
}

.dss-woo-panel__body::-webkit-scrollbar { width: 4px; }
.dss-woo-panel__body::-webkit-scrollbar-track { background: transparent; }
.dss-woo-panel__body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* Panel Footer */
.dss-woo-panel__footer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 18px;
    flex-shrink: 0;
    background: #f8fafc;
}

.dss-woo-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    margin-bottom: 14px;
    color: #1e293b;
}

.dss-woo-subtotal strong {
    font-size: 17px;
    font-weight: 700;
}

.dss-woo-btn-checkout {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    background: var(--dss-woo-accent) !important;
    color: #fff !important;
    text-align: center !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    box-sizing: border-box !important;
    transition: background .2s, transform .15s;
    cursor: pointer;
}

.dss-woo-btn-checkout:hover {
    background: var(--dss-woo-accent-dk) !important;
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* ── Cart Items ── */
.dss-woo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}

.dss-woo-item:last-child { border-bottom: none; }
.dss-woo-item:hover { background: #f8fafc; }

.dss-woo-item__thumb {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: block;
}

.dss-woo-item__info {
    flex: 1;
    min-width: 0;
}

.dss-woo-item__name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.dss-woo-item__name:hover { color: var(--dss-woo-accent); text-decoration: none; }

.dss-woo-item__price {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px;
}

.dss-woo-item__line-total {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Quantity controls */
.dss-woo-qty {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin-bottom: 6px;
}

.dss-woo-qty__btn,
.dss-woo-qty__btn:not(.wp-block-button__link) {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    color: #475569 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    box-sizing: border-box !important;
}

.dss-woo-qty__btn:hover:not(:disabled) {
    background: var(--dss-woo-accent) !important;
    color: #fff !important;
}

.dss-woo-qty__btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
}

.dss-woo-qty__val {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    padding: 0 4px;
    border: none;
    background: transparent;
    pointer-events: none;
    display: block;
}

/* Remove button */
.dss-woo-item__remove,
.dss-woo-item__remove:not(.wp-block-button__link) {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    margin: 0 !important;
    cursor: pointer;
    color: #94a3b8 !important;
    border-radius: 6px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    margin-top: 2px !important;
    transition: color .15s, background .15s;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.dss-woo-item__remove:hover {
    color: #dc2626 !important;
    background: #fee2e2 !important;
}

/* ── Loading ── */
.dss-woo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    color: #94a3b8;
    font-size: 13px;
}

.dss-woo-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--dss-woo-accent);
    border-radius: 50%;
    animation: dssWooSpin .7s linear infinite;
}

@keyframes dssWooSpin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.dss-woo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 20px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

.dss-woo-empty svg { opacity: 0.35; }

/* ── Overlay ── */
.dss-woo-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.35) !important;
    z-index: 99998 !important;
    opacity: 0;
    transition: opacity .25s ease;
    cursor: pointer;
}

.dss-woo-overlay:not([hidden]) { opacity: 1; }

/* ── Item updating ── */
.dss-woo-item--updating {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .dss-woo-minicart { --dss-woo-panel-w: calc(100vw - 32px); }

    .dss-woo-pos--bottom-right,
    .dss-woo-pos--top-right  { right: 16px !important; }
    .dss-woo-pos--bottom-left,
    .dss-woo-pos--top-left   { left: 16px !important; }
    .dss-woo-pos--bottom-right,
    .dss-woo-pos--bottom-left { bottom: 16px !important; }
}

/* ── Modal login/registro ── */
.dss-price-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: dssFadeIn 0.18s ease;
}
.dss-price-modal-overlay[hidden] {
    display: none;
}
@keyframes dssFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.dss-price-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: dssSlideUp 0.22s ease;
    overflow: hidden;
}
@keyframes dssSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.dss-price-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}
.dss-price-modal__title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}
.dss-price-modal__close {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    background: #f1f5f9 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    flex-shrink: 0 !important;
    transition: background 0.15s, color 0.15s;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    outline: none;
    text-decoration: none !important;
}
.dss-price-modal__close:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}
.dss-price-modal__close svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    fill: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
}
.dss-price-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 24px;
}
.dss-price-modal__body::-webkit-scrollbar { width: 4px; }
.dss-price-modal__body::-webkit-scrollbar-track { background: transparent; }
.dss-price-modal__body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
/* Estilos para el formulario de WooCommerce dentro del modal */
.dss-price-modal__body .woocommerce-form-login,
.dss-price-modal__body .woocommerce-form-register {
    padding: 0;
    border: none;
    box-shadow: none;
}
.dss-price-modal__body h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1e293b;
}
.dss-price-modal__body .woocommerce-Input,
.dss-price-modal__body input[type="text"],
.dss-price-modal__body input[type="email"],
.dss-price-modal__body input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 4px;
    box-sizing: border-box;
}
.dss-price-modal__body .button,
.dss-price-modal__body input[type="submit"] {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dss-price-modal__body .button:hover,
.dss-price-modal__body input[type="submit"]:hover {
    background: #135e96;
}
.dss-price-modal__body .u-column1,
.dss-price-modal__body .u-column2 {
    float: none;
    width: 100%;
}
.dss-price-modal__body .col2-set { overflow: hidden; }
.dss-price-modal__body .col2-set + .col2-set { margin-top: 24px; }

/* ── Precio oculto para visitantes ── */
.dss-price-guests {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 8px 14px;
    background: #f0f6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2271b1;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.5;
}
.dss-price-guests__link {
    color: #2271b1;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}
.dss-price-guests__link:hover {
    color: #1a5a9a;
}
