
/* =====================================================
   MINICART SHOPAGE - DISEÑO PONTRAGA
   ===================================================== */

/* Contenedor del icono y del desplegable */
.af-cart-wrapper.dropdown {
    position: relative !important;
}

/* Panel del minicart */
.af-cart-wrapper .top-cart-content.dropdown-menu {
    box-sizing: border-box !important;
    width: 460px !important;
    max-width: calc(100vw - 24px) !important;
    padding: 20px !important;
    margin: 0 !important;

    background: #fff !important;
    color: #222 !important;
    border: 1px solid #dedede !important;
    border-radius: 5px !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14) !important;

    z-index: 99999 !important;
    text-align: left !important;
}

/* Mostrar al pasar el ratón por el icono, en escritorio */
@media (min-width: 992px) {
    .af-cart-wrapper:hover .top-cart-content.dropdown-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .af-cart-wrapper .top-cart-content.dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Lista de productos */
.af-cart-wrapper .site-header-cart,
.af-cart-wrapper .woocommerce-mini-cart.cart_list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.af-cart-wrapper .site-header-cart > li {
    margin: 0 !important;
    padding: 0 !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item.mini_cart_item {
    position: relative !important;
    display: flow-root !important;
    min-height: 82px;
    margin: 0 !important;
    padding: 14px 26px 14px 0 !important;
    border-bottom: 1px solid #e6e6e6 !important;
    overflow-wrap: anywhere;
}

/* Imagen del producto */
.af-cart-wrapper .woocommerce-mini-cart-item > a:not(.remove) img {
    float: left !important;
    width: 76px !important;
    height: 76px !important;
    object-fit: contain !important;
    margin: 0 14px 8px 0 !important;
    padding: 0 !important;
}

/* Enlace y nombre del producto */
.af-cart-wrapper .woocommerce-mini-cart-item > a:not(.remove) {
    color: #222 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    text-decoration: none !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item > a:not(.remove):hover {
    color: #333 !important;
    text-decoration: underline !important;
}

/* Referencia del producto */
.af-cart-wrapper .woocommerce-mini-cart-item .product-sku {
    display: inline-block !important;
    margin-top: 4px !important;
    color: #777 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
}

/* Variaciones: atributos del producto */
.af-cart-wrapper .woocommerce-mini-cart-item dl.variation {
    display: block !important;
    clear: both !important;
    margin: 8px 0 6px 90px !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: #666 !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item dl.variation dt {
    float: left !important;
    clear: left !important;
    margin: 0 4px 3px 0 !important;
    font-weight: 600 !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item dl.variation dd {
    margin: 0 0 3px !important;
    padding: 0 !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item dl.variation p {
    margin: 0 !important;
}

/* Cantidad y precio */
.af-cart-wrapper .woocommerce-mini-cart-item .quantity {
    display: block !important;
    clear: both !important;
    margin: 10px 0 0 90px !important;
    color: #222 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item .amount {
    font-weight: 700 !important;
}

/* Botón de eliminar producto */
.af-cart-wrapper .woocommerce-mini-cart-item a.remove {
    position: absolute !important;
    top: 12px !important;
    right: 0 !important;
    left: auto !important;
    float: none !important;

    width: 22px !important;
    height: 22px !important;
    line-height: 20px !important;
    text-align: center !important;

    color: #777 !important;
    font-size: 20px !important;
    text-decoration: none !important;
    background: transparent !important;
    border-radius: 50% !important;
}

.af-cart-wrapper .woocommerce-mini-cart-item a.remove:hover {
    color: #222 !important;
    background: #f2f2f2 !important;
}

/* Subtotal */
.af-cart-wrapper .woocommerce-mini-cart__total.total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;

    margin: 18px 0 !important;
    padding: 0 !important;
    border: 0 !important;

    color: #222 !important;
    font-size: 14px !important;
}

.af-cart-wrapper .woocommerce-mini-cart__total strong {
    font-weight: 600 !important;
}

.af-cart-wrapper .woocommerce-mini-cart__total .amount {
    font-size: 20px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* Botones inferiores */
.af-cart-wrapper .woocommerce-mini-cart__buttons.buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;

    margin: 0 !important;
    padding: 0 !important;
}

.af-cart-wrapper .woocommerce-mini-cart__buttons .button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 43px !important;
    margin: 0 !important;
    padding: 11px 14px !important;

    border-radius: 3px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
}

/* Ver carrito: botón secundario */
.af-cart-wrapper .woocommerce-mini-cart__buttons .button.wc-forward:not(.checkout) {
    color: #0757b8 !important;
    background: #fff !important;
    border: 1px solid #0757b8 !important;
}

.af-cart-wrapper .woocommerce-mini-cart__buttons .button.wc-forward:not(.checkout):hover {
    background: #f3f7fc !important;
}

/* Finalizar compra: botón amarillo */
.af-cart-wrapper .woocommerce-mini-cart__buttons .button.checkout {
    color: #111 !important;
    background: #ffc600 !important;
    border: 1px solid #ffc600 !important;
}

.af-cart-wrapper .woocommerce-mini-cart__buttons .button.checkout:hover {
    background: #f0b900 !important;
    border-color: #f0b900 !important;
}

/* Mensaje cuando la cesta está vacía */
.af-cart-wrapper .woocommerce-mini-cart__empty-message {
    margin: 8px 0 !important;
    padding: 14px 0 !important;
    color: #555 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Adaptación a pantallas estrechas */
@media (max-width: 991px) {
    .af-cart-wrapper .top-cart-content.dropdown-menu {
        width: 420px !important;
        max-width: calc(100vw - 20px) !important;
        right: 0 !important;
        left: auto !important;
    }
}


/* Permitir que el minicart se muestre también en carrito y checkout */
body.woocommerce-cart .af-cart-wrapper .top-cart-content.primary-bgcolor,
body.woocommerce-checkout .af-cart-wrapper .top-cart-content.primary-bgcolor {
    display: none;
}

body.woocommerce-cart .af-cart-wrapper:hover .top-cart-content.primary-bgcolor,
body.woocommerce-cart .af-cart-wrapper:focus-within .top-cart-content.primary-bgcolor,
body.woocommerce-checkout .af-cart-wrapper:hover .top-cart-content.primary-bgcolor,
body.woocommerce-checkout .af-cart-wrapper:focus-within .top-cart-content.primary-bgcolor {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}