/**
 * Geo Service Muebles — Service Muebles brand (logo: amarillo #F5C518, negro, blanco)
 */

:root {
    --geo-yellow: #F5C518;
    --geo-yellow-hover: #E0B210;
    --geo-yellow-muted: rgba(245, 197, 24, 0.15);
    --geo-black: #0D0D0D;
    --geo-surface: #141414;
    --geo-surface-2: #1E1E1E;
    --geo-white: #FFFFFF;
    --geo-muted: #B8B8B8;
    --geo-muted-dark: #8A8A8A;
    --geo-overlay: rgba(0, 0, 0, 0.72);
    --geo-danger: #C62828;
    --geo-success: #2E7D32;
}

/* Aviso de tiempos de despacho (checkout) */
.geo-dispatch-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.35);
    border-left: 3px solid var(--geo-yellow);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 24px;
}

.geo-dispatch-notice__icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--geo-yellow);
    color: var(--geo-black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.geo-dispatch-notice__icon svg {
    display: block;
    width: 17px !important;
    height: 17px !important;
    max-width: 17px;
}

.geo-dispatch-notice__content {
    flex: 1 1 auto;
    min-width: 0;
}

.geo-dispatch-notice__title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--geo-black);
    margin-bottom: 3px;
}

.geo-dispatch-notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #5A5A5A;
}

/* Modal principal */
.geo-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--geo-overlay);
    backdrop-filter: blur(8px);
    animation: geoFadeIn 0.3s ease-in-out;
}

.geo-modal-content {
    position: relative;
    margin: 6% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    animation: geoSlideIn 0.35s ease-out;
    overflow: hidden;
    font-family: inherit;
}

/* Cabecera: franja amarilla como el círculo del logo + “SM” negro */
.geo-modal-header {
    background: var(--geo-yellow);
    color: var(--geo-black);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.geo-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: var(--geo-black);
}

.geo-modal-close {
    background: rgba(13, 13, 13, 0.08);
    border: none;
    color: var(--geo-black);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.geo-modal-close:hover {
    background-color: rgba(13, 13, 13, 0.18);
}

.geo-modal-close:active {
    transform: scale(0.95);
}

/* Cuerpo: superficie oscura, texto claro (+10 años / lectura en negro del logo → contraste inverso aquí) */
.geo-modal-body {
    padding: 1.5rem 1.5rem 1.25rem;
    background: var(--geo-surface);
    color: inherit;
}

#geo-benefit-content h4 {
    margin: 0 0 12px 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--geo-yellow);
    letter-spacing: 0.01em;
}

#geo-benefit-content p {
    margin: 0 0 14px 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--geo-muted);
}

.benefit-details {
    background: var(--geo-surface-2);
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--geo-yellow);
    margin-top: 14px;
}

.benefit-details p {
    margin: 6px 0;
    font-size: 0.8125rem;
    color: var(--geo-muted);
}

.benefit-details strong {
    color: var(--geo-yellow);
    font-weight: 600;
}

/* Pie */
.geo-modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: #0F0F0F;
    border-top: 1px solid rgba(245, 197, 24, 0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* Botones */
.geo-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 108px;
    letter-spacing: 0.02em;
}

.geo-btn-primary {
    background: var(--geo-yellow) !important;
    color: var(--geo-black) !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.geo-btn-primary:hover {
    background: var(--geo-yellow-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.35);
}

.geo-btn-primary:active {
    transform: translateY(0);
}

.geo-btn-primary:disabled {
    background: #555 !important;
    color: #BDBDBD !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.geo-btn-secondary {
    background: transparent;
    color: var(--geo-white);
    border: 2px solid rgba(255, 255, 255, 0.38);
}

.geo-btn-secondary:hover {
    border-color: var(--geo-yellow);
    color: var(--geo-yellow);
    background: var(--geo-yellow-muted);
}

/* Notificaciones */
.geo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 1000000;
    max-width: 360px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    animation: geoSlideInRight 0.35s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.geo-notification.geo-success {
    background: var(--geo-black);
    color: var(--geo-white);
    border-left: 4px solid var(--geo-yellow);
}

.geo-notification.geo-error {
    background: var(--geo-black);
    color: var(--geo-white);
    border-left: 4px solid var(--geo-danger);
}

.geo-notification span {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.geo-notification-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--geo-white);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.geo-notification-close:hover {
    background-color: rgba(255, 255, 255, 0.22);
}

@keyframes geoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes geoSlideIn {
    from {
        transform: translateY(-28px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes geoSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .geo-modal-content {
        width: 94%;
        margin: 12% auto;
    }

    .geo-modal-header {
        padding: 16px 18px;
    }

    .geo-modal-header h3 {
        font-size: 1rem;
    }

    .geo-modal-body {
        padding: 1.25rem;
    }

    .geo-modal-footer {
        padding: 12px 1.25rem 1.15rem;
        flex-direction: column;
    }

    .geo-btn {
        width: 100%;
    }

    .geo-notification {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .geo-modal-content {
        width: 96%;
        margin: 8% auto;
    }

    .geo-modal-header {
        padding: 14px 16px;
    }

    .geo-modal-body {
        padding: 1.15rem;
    }

    .geo-modal-footer {
        padding: 12px 16px 1rem;
    }

    .geo-btn {
        font-size: 0.8125rem;
        padding: 10px 16px;
    }
}

.geo-modal:focus {
    outline: none;
}

.geo-btn:focus-visible {
    outline: 2px solid var(--geo-yellow);
    outline-offset: 2px;
}

.geo-modal-close:focus-visible {
    outline: 2px solid var(--geo-black);
    outline-offset: 2px;
}

/* Selector de ciudad */
.geo-selector-label {
    margin: 0 0 14px 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--geo-muted);
}

.geo-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--geo-surface-2);
    color: var(--geo-white);
    border: 2px solid rgba(245, 197, 24, 0.25);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F5C518' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
}

.geo-select:focus {
    outline: none;
    border-color: var(--geo-yellow);
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

.geo-select option {
    background: var(--geo-surface-2);
    color: var(--geo-white);
}

/* Espaciado entre select de departamento y municipio */
#geo-dept-select {
    margin-bottom: 12px;
}

#geo-city-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#geo-benefit-content {
    margin-top: 18px;
}

/* ── fin selector de ciudad ── */

.geo-loading {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid var(--geo-yellow-muted);
    border-top-color: var(--geo-yellow);
    border-radius: 50%;
    animation: geoSpin 0.75s linear infinite;
}

@keyframes geoSpin {
    to { transform: rotate(360deg); }
}

/* ── Envío con descuento (precio tachado en carrito) ─────────────────── */
.geo-shipping-badge {
    display: inline-block;
    background: #F5C518;
    color: #141414;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Fila de descuento en envío en los totales del carrito / checkout */
.geo-shipping-discount-row th,
.geo-shipping-discount-row td {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.95em;
    color: var(--geo-success, #2E7D32);
}

.geo-shipping-discount-row th {
    font-weight: 600;
}

.geo-shipping-discount-row .geo-shipping-badge {
    font-size: 10px;
    padding: 1px 5px;
}

.geo-shipping-original {
    color: #C62828;
    margin-right: 6px;
    font-size: 0.9em;
}

/* En mobile el badge baja a su propia línea para no tapar el precio */
@media (max-width: 600px) {
    .woocommerce-shipping-methods label,
    #shipping_method li label {
        white-space: normal;
        word-break: break-word;
    }

    .geo-shipping-badge {
        display: inline-block;
        margin-left: 0;
        margin-top: 4px;
        vertical-align: top;
        /* forzar salto de línea antes del badge */
        float: none;
    }

    /* Salto antes del badge usando un pseudo-contenedor en el label */
    .woocommerce-shipping-methods label .geo-shipping-badge,
    #shipping_method li label .geo-shipping-badge {
        display: block;
        width: fit-content;
        margin-top: 3px;
    }
}

.geo-coupon-shipping-label {
    font-weight: 600;
    color: #2E7D32;
}

/* ── Barra de progreso hacia monto mínimo del beneficio ─────────────── */
.geo-benefit-bar-wrap {
    background: var(--geo-surface);
    border: 1px solid rgba(245, 197, 24, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: var(--geo-white);
    font-family: inherit;
    transition: border-color 0.4s ease, background 0.4s ease;
}

.geo-benefit-bar-wrap.geo-bar-done {
    border-color: rgba(46, 125, 50, 0.5);
    background: rgba(46, 125, 50, 0.07);
}

.geo-bar-label {
    margin: 0 0 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--geo-muted);
}

.geo-bar-label strong {
    color: var(--geo-yellow);
    font-weight: 700;
}

.geo-bar-done .geo-bar-label strong {
    color: #4CAF50;
}

.geo-bar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    height: 7px;
    overflow: hidden;
}

.geo-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #F5C518 0%, #FFE066 100%);
    border-radius: 20px;
    min-width: 4px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.geo-bar-done .geo-bar-fill {
    background: linear-gradient(90deg, #2E7D32 0%, #4CAF50 100%);
}

/* Aviso sutil cuando el carrito tiene un producto de compra individual
   (excluido de beneficios): reemplaza la barra de progreso normal. */
.geo-benefit-bar-wrap.geo-benefit-bar-excluded {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.geo-bar-excluded-note {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--geo-muted, #A0A0A0);
    font-weight: 500;
}

/* Mini-carrito: reducir padding */
.widget_shopping_cart .geo-benefit-bar-wrap {
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.widget_shopping_cart .geo-bar-label {
    font-size: 0.8125rem;
    margin-bottom: 8px;
}

.widget_shopping_cart .geo-bar-track {
    height: 5px;
}

@media (max-width: 768px) {
    .geo-benefit-bar-wrap {
        padding: 12px 14px;
    }
}

/* ── Etiquetas de producto: descuento por ubicación / excluido ───────── */
.geo-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--geo-black, #0D0D0D);
    border: 1px solid var(--geo-yellow, #F5C518);
    border-radius: 20px;
    white-space: nowrap;
    padding: 4px 10px 4px 4px;
}

.geo-product-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--geo-yellow, #F5C518);
    color: var(--geo-black, #0D0D0D);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.geo-product-badge-text {
    color: var(--geo-yellow, #F5C518);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Variante: producto excluido de los beneficios geo (color distintivo, más compacta) */
.geo-product-badge-excluded {
    border-color: var(--geo-danger, #C62828);
    gap: 4px;
    padding: 3px 8px 3px 3px;
}

.geo-product-badge-excluded .geo-product-badge-icon {
    width: 13px;
    height: 13px;
    font-size: 8px;
    background: var(--geo-danger, #C62828);
    color: var(--geo-white, #FFFFFF);
}

.geo-product-badge-excluded .geo-product-badge-text {
    font-size: 9px;
    color: var(--geo-danger, #C62828);
}

/* Catálogo / listado (shop, categoría, relacionados, etc.) */
ul.products li.product {
    position: relative;
}

.geo-product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.geo-product-badges .geo-product-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* En mobile, subir un poco la etiqueta para que no tape el título del producto */
@media (max-width: 768px) {
    .geo-product-badges {
        top: 4px;
        left: 4px;
        gap: 3px;
    }
}

/* Página de producto individual */
.geo-product-badge-single {
    margin-bottom: 12px;
}

.geo-product-badge-single .geo-product-badge {
    padding: 5px 12px 5px 5px;
}

.geo-product-badge-single .geo-product-badge-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
}

.geo-product-badge-single .geo-product-badge-text {
    font-size: 11px;
}

/* La etiqueta de excluido se mantiene compacta también en la página de producto */
.geo-product-badge-single .geo-product-badge-excluded {
    padding: 3px 8px 3px 3px;
}

.geo-product-badge-single .geo-product-badge-excluded .geo-product-badge-icon {
    width: 13px;
    height: 13px;
    font-size: 8px;
}

.geo-product-badge-single .geo-product-badge-excluded .geo-product-badge-text {
    font-size: 9px;
}

/* Aviso de compra exclusiva en la página de producto individual */
.geo-product-exclusive-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(198, 40, 40, 0.08);
    border: 1px solid var(--geo-danger, #C62828);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    color: var(--geo-danger, #C62828);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Enlace "Elimínalo del carrito" dentro del aviso de WooCommerce cuando el
   bloqueo lo causa un producto exclusivo ya presente en el carrito. */
.woocommerce-error a.geo-remove-exclusive-link {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 10px;
    background: var(--geo-danger, #C62828);
    color: #fff;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

.woocommerce-error a.geo-remove-exclusive-link:hover {
    background: #a92222;
    color: #fff;
}

/* Botón flotante: reabre el selector de ubicación / cupón en cualquier momento */
.geo-float-btn {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 999998; /* justo debajo del modal (999999) y la notificación (1000000) */
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--geo-black);
    color: var(--geo-white);
    border: 1px solid rgba(245, 197, 24, 0.35);
    border-radius: 999px;
    padding: 12px 18px 12px 14px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 197, 24, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    animation: geoFloatBtnIn 0.4s ease-out;
}

.geo-float-btn:hover,
.geo-float-btn:focus-visible {
    transform: translate(-50%, -2px);
    background: var(--geo-surface-2);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 197, 24, 0.28);
}

.geo-float-btn:active {
    transform: translate(-50%, 0);
}

.geo-float-btn-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.geo-float-btn-text {
    white-space: nowrap;
}

@keyframes geoFloatBtnIn {
    from { opacity: 0; transform: translateY(12px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En móvil, priorizar el ícono para no chocar con barras de WooCommerce / WhatsApp flotantes */
@media (max-width: 480px) {
    .geo-float-btn {
        bottom: 14px;
        padding: 12px;
        gap: 0;
    }

    .geo-float-btn-text {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Popup de Aviso General (activable/desactivable desde el admin)
   ═══════════════════════════════════════════════════════════════ */

.geo-announcement-overlay {
    display: none;
    position: fixed;
    z-index: 1000001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--geo-overlay);
    backdrop-filter: blur(8px);
    animation: geoFadeIn 0.3s ease-in-out;
}

.geo-announcement-modal {
    position: relative;
    margin: 8% auto;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 14px;
    width: 90%;
    max-width: 460px;
    background: var(--geo-surface);
    color: var(--geo-white);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 197, 24, 0.18);
    border-top: 4px solid var(--geo-yellow);
    animation: geoSlideIn 0.35s ease-out;
    text-align: center;
}

.geo-announcement-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--geo-white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.geo-announcement-close:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

.geo-announcement-close:active {
    transform: scale(0.95);
}

.geo-announcement-logo {
    margin: 0 0 1rem;
}

.geo-announcement-logo img {
    max-width: 160px;
    max-height: 72px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
}

.geo-announcement-title {
    margin: 0 0 0.9rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--geo-yellow);
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.geo-announcement-message {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--geo-muted);
    text-align: left;
}

.geo-announcement-message p {
    margin: 0 0 0.9em;
}

.geo-announcement-message p:last-child {
    margin-bottom: 0;
}

.geo-announcement-accept {
    min-width: 160px;
}

@media (max-width: 600px) {
    .geo-announcement-modal {
        margin: 20% auto;
        padding: 1.75rem 1.25rem 1.5rem;
        width: 92%;
    }
}
