/* =============================================================================
   Widgets Cuenta y Carrito Oliva
   ============================================================================= */

/* ── Disparador del carrito ──────────────────────────────────────────────── */
.oliva-cart { display: inline-flex; position: relative; }
.oliva-cart-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 6px;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    color: inherit;
}
.oliva-cart-icon { display: inline-flex; line-height: 0; }
.oliva-cart-icon i   { line-height: 1; }
.oliva-cart-icon svg { display: block; }

/* Sin recuadro/fondo en hover-focus del botón del carrito. */
.oliva-cart-trigger:hover,
.oliva-cart-trigger:focus,
.oliva-cart-trigger:active,
.oliva-cart-trigger:focus-visible {
    background: none !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: none !important;
}

/* Contador */
.oliva-cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #7a3a22;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}
.oliva-cart-count.is-empty { display: none; }
.oliva-cart--nocount .oliva-cart-count { display: none !important; }

/* ── Fondo oscuro (overlay) ──────────────────────────────────────────────── */
.oliva-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.oliva-cart-overlay.is-open { opacity: 1; visibility: visible; }

/* ── Panel lateral ───────────────────────────────────────────────────────── */
.oliva-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 400px;
    max-width: 100vw;
    background: #fff;
    color: #1a1a1a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}
.oliva-cart-panel.is-open { transform: translateX(0); }

.oliva-cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
    flex-shrink: 0;
}
.oliva-cart-panel-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.15;
    color: #fff;
    text-transform: none;
    letter-spacing: normal;
}
.oliva-cart-close {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px;
    color: inherit;
    transition: none;
}
/* Sin hover en la X de cerrar */

.oliva-cart-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 22px 24px;
}

/* =============================================================================
   Contenido del mini-cart. IMPORTANTE: Elementor Pro reemplaza el mini-cart de
   WooCommerce por su "Menu Cart" (clases .elementor-menu-cart__*), por eso hay
   que apuntar a ESAS clases (no a .woocommerce-mini-cart*). Prefijo largo +
   !important para ganarle al CSS de Elementor/tema.
   ============================================================================= */

/* Nombre del producto: Montserrat semibold 18px, blanco */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-name a,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-name a:hover,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-name a:focus {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* Precio de línea (cantidad × precio): Montserrat regular 16px, blanco */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .quantity,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .product-quantity,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .woocommerce-Price-amount,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .woocommerce-Price-currencySymbol,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price bdi {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    color: #fff !important;
}

/* Subtotal: sin recuadro, alineado a la derecha, Montserrat, blanco */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__subtotal {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: baseline !important;
    gap: 8px !important;
    text-align: right !important;
    font-family: 'Montserrat', sans-serif !important;
    color: #fff !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    padding: 16px 0 !important;
    margin: 0 !important;
}
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__subtotal strong,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__subtotal .woocommerce-Price-amount,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__subtotal bdi {
    font-family: 'Montserrat', sans-serif !important;
    color: #fff !important;
}

/* Botones (Elementor Menu Cart): APILADOS, cada uno a ancho completo, con estilo
   "botones-oliva-blanco" (texto + flecha blanca, fondo transparente, sin borde). */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button:hover,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button:focus {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    box-shadow: none !important;
    border-radius: 5px !important;
    padding: 13px 20px !important;
    color: #fff !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    transition: none !important;
}
/* "Ver carrito": fondo negro */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--view-cart,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--view-cart:hover,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--view-cart:focus {
    background: #000 !important;
    background-color: #000 !important;
    border: 1px solid #000 !important;
    color: #fff !important;
}
/* "Finalizar compra": fondo transparente, borde 1px sólido blanco */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--checkout,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--checkout:hover,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button--checkout:focus {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid #fff !important;
    color: #fff !important;
}
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button .elementor-button-text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px !important;
    color: #fff !important;
    flex: 0 0 auto !important;
}
/* Flecha blanca (cola + punta) tras el texto, con crecimiento en hover */
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button::before {
    content: "";
    order: 2;
    display: inline-block;
    width: 10px;
    height: 1.5px;
    margin-left: 10px;
    flex-shrink: 0;
    background-color: #fff;
    transition: width .35s ease;
}
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button::after {
    content: "";
    order: 3;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: -4px;
    border-top: 1.5px solid #fff;
    border-right: 1.5px solid #fff;
    border-bottom: 0;
    border-left: 0;
    background: none;
    transform: rotate(45deg);
    flex-shrink: 0;
}
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button:hover::before,
body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button:focus::before {
    width: 28px;
}

/* Responsive móvil (≤767px) */
@media (max-width: 767px) {
    .oliva-cart-panel-title { font-size: 18px; }
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-name a { font-size: 16px !important; }
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price,
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .quantity,
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .product-quantity,
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price .woocommerce-Price-amount,
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__product-price bdi { font-size: 14px !important; }
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button,
    body .oliva-cart-panel .oliva-cart-panel-body .elementor-menu-cart__footer-buttons .elementor-button .elementor-button-text { font-size: 14px !important; }
}

/* ── Login / Cuenta ──────────────────────────────────────────────────────── */
.oliva-login { display: inline-flex; position: relative; }
.oliva-login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 6px;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    color: inherit;
    text-decoration: none;
}
.oliva-login-icon i   { line-height: 1; }
.oliva-login-icon svg { display: block; }

/* Sin recuadro/fondo en hover-focus del icono: el hover solo despliega el menú. */
.oliva-login-icon:hover,
.oliva-login-icon:focus,
.oliva-login-icon:active,
.oliva-login-icon:focus-visible {
    background: none !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: none !important;
}

/* Menú desplegable */
.oliva-login-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
    padding: 6px;
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
/* puente invisible para que el hover no se corte entre icono y menú */
.oliva-login-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}
.oliva-login:hover .oliva-login-menu,
.oliva-login:focus-within .oliva-login-menu,
.oliva-login.is-open .oliva-login-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.oliva-login-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
}
.oliva-login-menu a:hover { background: rgba(0, 0, 0, .05); }

/* No permitir scroll de fondo cuando el carrito está abierto */
body.oliva-cart-open { overflow: hidden; }
