/*
Theme Name: Uniderma Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/


/* SOLUCIÓN MODERNA PARA SCROLL SHIFT - Reserva espacio del scrollbar */
/* Siempre reservar espacio para scrollbar */

@media only screen and (max-width: 48em) {
    /*************** ADD MOBILE ONLY CSS HERE  ***************/
}

.woocommerce-account .woocommerce {
    display: flex;
    gap: 30px;
}

/* Menú izquierdo */
.woocommerce-MyAccount-navigation {
    width: 260px;
    border-right: 1px solid #ddd;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
}

.woocommerce-MyAccount-navigation li {
    margin-bottom: 10px;
}

.woocommerce-MyAccount-navigation li a {
    display: block;
    padding: 12px;
    border: 1px solid #000;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-MyAccount-navigation li.is-active a {
    background: #000;
    color: #fff;
}

/* Contenido derecho */
.woocommerce-MyAccount-content {
    flex: 1;
}


/****COMO**/

.badge-inner.promo-badge {
    background-color: #08a7f6;
}


/* Ocultar libro de reclamaciones para usuarios no logeados */
/* body:not(.logged-in) .libro-reclamaciones-wrap {
    display: none !important;
} */

.out-of-stock-label {
    display: none !important;
}

/* --- UNIDERMA: PRODUCT BADGE UPDATES (STACKED OVERLAY STYLE) --- */

/* El contenedor principal de badges sigue siendo una superposición absoluta a la imagen, 
   pero usamos flexbox para apilar a los hijos en columna. */
.badge-container.absolute.left.top {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin: 8px 0 0 8px !important;
    /* Separar del borde superior/izquierdo de la imagen */
}

/* Evitar que las formas de Flatsome interfieran con el apilamiento */
.badge-container.absolute.left.top .callout.badge {
    position: relative !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
}

/* El order negativo asegura que "Agotado" se muestre arriba del badge de Sale */
.uc-out-of-stock-badge-wrapper {
    order: -1 !important;
}

/* Estilo Agotado: Pequeño y elegante */
.badge-inner.uc-out-of-stock-badge {
    background-color: #455a64 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

/* Estilo Descuento: Forzar Rojo y Rectangular */
.badge-container .badge-inner.on-sale {
    /* Corrección a clase nativa .on-sale */
    background-color: #ff1744 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

/* Quitar dimensiones circulares forzadas por Flatsome (por ej: alto/ancho de 40px) */
.badge-container .badge-inner {
    border-radius: 4px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    /* Permite que abrace estrechamente el texto */
    padding: 4px 8px !important;
}

/* --- FIX ANTI-FLICKER VARIACIONES --- 
   Ocultamos los selects nativos inmediatamente por CSS. 
   Flatsome los reemplazará con botones/swatches rápidamente. */
.variations_form .variations select {
    display: none !important;
}

/* Opcional: Si el formulario da un "salto" al cargar, podemos 
   mantenerlo invisible hasta que WooCommerce lo inicialice */
.variations_form:not(.initialized) {
    opacity: 0;
}

.variations_form.initialized {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* ========================================================
CAMBIAR EL FONDO DE MAIN A #f4f5f8
======================================================== */
#main {
    background-color: #f4f5f8;
}

/* ========================================================
VALIDACIÓN VISUAL — Inputs inválidos en rojo
======================================================== */

/* Transición suave para todos los inputs del sitio */
.uni-edit-inline input,
.uni-edit-inline select,
.uni-pw-form input,
.uc-step-panel input,
.uc-step-panel select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* :user-invalid → se activa SOLO después de que el usuario interactúa (no al cargar) */
.uni-edit-inline input:user-invalid,
.uni-edit-inline select:user-invalid,
.uni-pw-form input:user-invalid,
.uc-step-panel input:user-invalid,
.uc-step-panel select:user-invalid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
    outline: none !important;
}

/* Fallback: cuando el form tiene .was-validated (añadido por JS en submit) */
.was-validated input:invalid,
.was-validated select:invalid,
.was-validated textarea:invalid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
    outline: none !important;
}

/* Estado válido — borde verde discreto */
.was-validated input:valid,
.was-validated select:valid,
.was-validated textarea:valid {
    border-color: #27ae60 !important;
    box-shadow: none !important;
}

/* Feedback para inputs inválidos */
.invalid-feedback {
    display: none;
    color: #e74c3c;
    font-size: 11.5px;
    margin-top: 4px;
}

.was-validated input:invalid~.invalid-feedback,
.was-validated select:invalid~.invalid-feedback,
input:user-invalid~.invalid-feedback,
select:user-invalid~.invalid-feedback {
    display: block !important;
}

/* ========================================================
   CUSTOM THANK YOU PAGE (ORDER RECEIVED)
   ======================================================== */
.woocommerce-order.custom-thankyou-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

/* Hide standard woocommerce success notice if present */
.woocommerce-notice--success.woocommerce-thankyou-order-received {
    display: none !important;
}

/* Full width breakout for split layout */
@media (min-width: 850px) {
    .woocommerce-order.custom-thankyou-wrapper {
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        margin-top: -30px;
        /* Offset Flatsome container padding */
    }

    .ct-layout {
        display: flex;
        min-height: 80vh;
    }

    .ct-main {
        flex: 1 1 55%;
        padding: 5% 40px 5% calc(50vw - 525px);
        /* Max inner width ~1050px */
        background: #fff;
        border-right: 1px solid #e1e1e1;
    }

    .ct-sidebar {
        flex: 1 1 45%;
        background: #fafafa;
        padding: 5% calc(50vw - 525px) 5% 40px;
    }
}

@media (max-width: 849px) {
    .ct-layout {
        display: flex;
        flex-direction: column;
    }

    .ct-main {
        padding: 30px 15px;
        background: #fff;
    }

    .ct-sidebar {
        padding: 30px 15px;
        background: #fafafa;
        border-top: 1px solid #e1e1e1;
    }
}

.ct-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.ct-check-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ct-header-text .ct-order-num {
    font-size: 13px;
    color: #737373;
    display: block;
    margin-bottom: 5px;
}

.ct-header-text h2 {
    font-size: 24px;
    margin: 0;
    font-weight: 400;
    line-height: 1.2;
}

.ct-map-placeholder {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
    background: #fff;
}

.ct-map-placeholder img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.ct-map-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.ct-map-info span {
    font-size: 12px;
    color: #737373;
    margin-bottom: 3px;
}

.ct-map-info strong {
    font-size: 14px;
    font-weight: 500;
}

.ct-status-box {
    margin-bottom: 40px;
}

.ct-status-box h3 {
    font-size: 18px;
    margin: 0 0 5px;
    font-weight: 500;
}

.ct-status-box p {
    margin: 0;
    color: #737373;
    font-size: 14px;
}

.ct-details-box {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.ct-details-box h3 {
    font-size: 16px;
    margin: 0 0 20px;
    font-weight: 600;
}

.ct-details-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.ct-col {
    flex: 1 1 45%;
    min-width: 200px;
}

.ct-full-col {
    flex: 1 1 100%;
}

.ct-col h4 {
    font-size: 13px;
    color: #333;
    margin: 0 0 8px;
    font-weight: 600;
}

.ct-col p {
    font-size: 13px;
    color: #737373;
    margin: 0;
    line-height: 1.5;
}

.ct-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e1e1e1;
    flex-wrap: wrap;
    gap: 15px;
}

.ct-help {
    font-size: 14px;
    color: #333;
}

.ct-help a {
    color: #000;
    text-decoration: underline;
}

.ct-btn-continue {
    background: #000;
    color: #fff;
    padding: 16px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.ct-btn-continue:hover {
    background: #333;
    color: #fff;
}

.ct-footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ct-footer-links a {
    font-size: 12px;
    color: #737373;
    text-decoration: none;
}

.ct-footer-links a:hover {
    text-decoration: underline;
    color: #333;
}

/* Right Column */
.ct-order-items {
    border-bottom: 1px solid #e1e1e1;
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.ct-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.ct-item-img {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fff;
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.ct-item-qty {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(114, 114, 114, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ct-item-name {
    flex-grow: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    padding-right: 15px;
}

.ct-item-total {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.ct-summary {
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.ct-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #737373;
    margin-bottom: 12px;
}

.ct-summary-line:last-child {
    margin-bottom: 0;
}

.ct-summary-line span:last-child {
    font-weight: 500;
    color: #333;
}

.ct-final-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.ct-final-total span:last-child {
    font-size: 24px;
    font-weight: 600;
}

.ct-currency {
    font-size: 12px;
    color: #737373;
    margin-right: 5px;
    font-weight: normal;
}

.ct-gateway-instructions {
    padding: 40px 15px;
    max-width: 1050px;
    margin: 0 auto;
    clear: both;
}

/* Hide the default WooCommerce order and customer details tables to avoid duplication */
.ct-gateway-instructions .woocommerce-order-details,
.ct-gateway-instructions .woocommerce-customer-details {
    display: none !important;
}

/* Ocultar detalles técnicos de Niubiz en la página de Gracias */
.custom-thankyou-wrapper .ct-gateway-instructions {
    display: none !important;
}

/* ========================================================
   SLIDING LEFT DRAWER (SANDWICH MENU)
   ======================================================== */

/* Trigger Button Custom Styling - Pure Transparent Hamburger */
.uniderma-sandwich-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    /* Fully transparent background */
    color: #666666 !important;
    /* Neutral dark grey */
    border: none !important;
    border-radius: 0 !important;
    padding: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    outline: none !important;
    height: auto !important;
    box-shadow: none !important;
}

.uniderma-sandwich-btn:hover {
    background: transparent !important;
    color: #004b93 !important;
    /* Changes to brand blue on hover */
    transform: scale(1.1) !important;
    box-shadow: none !important;
}

.uniderma-sandwich-btn:active {
    transform: scale(0.9) !important;
}

/* Custom wrapper for desktop sandwich button to avoid inline flex-override on mobile */
.uniderma-desktop-sandwich-wrapper {
    padding-left: 15px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    transform: translateY(4px) !important;
}

@media (max-width: 849px) {
    .uniderma-desktop-sandwich-wrapper {
        display: none !important;
    }
}

/* Sidebar Drawer Overlay */
.uniderma-drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0) !important;
    /* Smooth fade-in overlay */
    backdrop-filter: blur(0px) !important;
    z-index: 99999 !important;
    /* Ensure it is above everything else */
    opacity: 0 !important;
    pointer-events: none !important;
    transition: background-color 0.4s ease, opacity 0.4s ease, backdrop-filter 0.4s ease !important;
}

.uniderma-drawer-overlay.is-open {
    background-color: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Drawer Container Box */
.uniderma-drawer-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 320px !important;
    max-width: 85% !important;
    height: 100% !important;
    background: #ffffff !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.uniderma-drawer-overlay.is-open .uniderma-drawer-content {
    transform: translateX(0) !important;
}

/* Drawer Header */
.uniderma-drawer-header {
    padding: 20px 24px !important;
    background: #004b93 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.uniderma-drawer-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
}

/* Close Button */
.uniderma-drawer-close-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s ease !important;
}

.uniderma-drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: rotate(90deg) !important;
}

/* Drawer Body */
.uniderma-drawer-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 24px !important;
    background: #f8fafc !important;
}

/* Prevent parent scroll when open */
body.uniderma-drawer-open {
    overflow: hidden !important;
}

/* modificacion de los mensajes de error, info y succes */

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 20px auto !important;
    max-width: 1357px !important;
    list-style: none !important;
    border: 1px solid transparent !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden !important;
}

.woocommerce-error li,
.woocommerce-message li,
.woocommerce-info li {
    list-style: none !important;
    margin: auto !important;
    padding: auto !important;
}

/* Contenedor del mensaje interno */
.woocommerce-error .message-container,
.woocommerce-message .message-container,
.woocommerce-info .message-container {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 18px !important;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Eliminar pseudo-elementos duplicados de Flatsome */
.woocommerce-error .message-container::before,
.woocommerce-message .message-container::before,
.woocommerce-info .message-container::before {
    display: none !important;
}

/* Iconos de las alertas */
.woocommerce-error .message-icon,
.woocommerce-message .message-icon,
.woocommerce-info .message-icon {
    font-size: 16px !important;
    padding: 6px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    position: static !important;
    top: auto !important;
}

/* 1. ESTILO DE ERRORES (Rojo / Alertas de stock, etc.) */
.woocommerce-error {
    background: #fff5f5 !important;
    border: 1px solid #fed7d7 !important;
    border-left: 5px solid #e53e3e !important;
}

.woocommerce-error .message-container {
    color: #c53030 !important;
}

.woocommerce-error .message-icon {
    color: #e53e3e !important;
    background: rgba(229, 62, 62, 0.1) !important;
}

/* 2. ESTILO DE ÉXITO (Verde / Cupones aplicados, etc.) */
.woocommerce-message {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 5px solid #22c55e !important;
}

.woocommerce-message .message-container {
    color: #15803d !important;
}

.woocommerce-message .message-icon {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.1) !important;
}

/* 3. ESTILO DE INFO (Azul / Avisos informativos, etc. - Color Uniderma) */
.woocommerce-info {
    background: #f0f7ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 5px solid #1a4f8a !important;
    /* Azul corporativo de Uniderma */
}

.woocommerce-info .message-container {
    color: #1e40af !important;
}

.woocommerce-info .message-icon {
    color: #1a4f8a !important;
    background: rgba(26, 79, 138, 0.1) !important;
}

.otp-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #203266 !important;
    color: white;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity .2s;
}

/* Ocultar botón Agregar al Carrito para productos agotados en el catálogo */
.outofstock .add_to_cart_button,
.outofstock .ajax_add_to_cart,
.outofstock .add-to-cart-grid-default,
.outofstock .uniderma-add-to-cart-btn {
    display: none !important;
}