/**
 * NAHR Cart - Frontend Styles
 * Con alta especificidad para evitar conflictos con temas
 */

:root {
    --nahr-cart-gold: #d4a15d;
    --nahr-cart-gold-dark: #c4914d;
    --nahr-cart-dark: #1a1a1a;
    --nahr-cart-text: #333;
    --nahr-cart-gray: #666;
    --nahr-cart-light: #f8f6f3;
    --nahr-cart-white: #ffffff;
    --nahr-cart-border: #e8e5e0;
    --nahr-cart-success: #28a745;
    --nahr-cart-danger: #dc3545;
}

/* ===================
   MINI CART CONTAINER
   =================== */
#nahr-mini-cart.nahr-mini-cart {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box !important;
}

#nahr-mini-cart.nahr-mini-cart * {
    box-sizing: border-box !important;
}

/* ===================
   MINI CART BUTTON - Alta especificidad
   =================== */
#nahr-mini-cart .nahr-mini-cart-toggle {
    position: relative !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #d4a15d 0%, #c4914d 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(212, 161, 93, 0.4) !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

#nahr-mini-cart .nahr-mini-cart-toggle:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 25px rgba(212, 161, 93, 0.5) !important;
}

#nahr-mini-cart .nahr-mini-cart-toggle:focus {
    outline: none !important;
    box-shadow: 0 4px 20px rgba(212, 161, 93, 0.4) !important;
}

/* SVG Icon - Forzar estilos */
#nahr-mini-cart .nahr-mini-cart-toggle svg {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    color: white !important;
    fill: none !important;
    stroke: white !important;
    stroke-width: 2 !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    position: static !important;
    transform: none !important;
    flex-shrink: 0 !important;
}

#nahr-mini-cart .nahr-mini-cart-toggle svg * {
    stroke: white !important;
    fill: none !important;
}

#nahr-mini-cart .nahr-mini-cart-toggle svg circle {
    fill: white !important;
    stroke: none !important;
}

/* Cart Count Badge */
#nahr-mini-cart .nahr-cart-count {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    left: auto !important;
    bottom: auto !important;
    min-width: 22px !important;
    height: 22px !important;
    background: #1a1a1a !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 6px !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    line-height: 1 !important;
    text-align: center !important;
    border: none !important;
}

#nahr-mini-cart .nahr-cart-count[data-count="0"] {
    display: none !important;
}

/* ===================
   MINI CART DROPDOWN
   =================== */
#nahr-mini-cart .nahr-mini-cart-dropdown {
    position: absolute !important;
    bottom: 75px !important;
    right: 0 !important;
    left: auto !important;
    top: auto !important;
    width: 380px !important;
    max-height: 80vh !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#nahr-mini-cart.active .nahr-mini-cart-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Header */
#nahr-mini-cart .nahr-mini-cart-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 18px 20px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e8e5e0 !important;
    background: #f8f6f3 !important;
}

#nahr-mini-cart .nahr-mini-cart-header h4 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    background: transparent !important;
    border: none !important;
}

#nahr-mini-cart .nahr-mini-cart-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    background: transparent !important;
    border: 1px solid #e8e5e0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 20px !important;
    color: #666 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    line-height: 1 !important;
}

#nahr-mini-cart .nahr-mini-cart-close:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Content */
#nahr-mini-cart .nahr-mini-cart-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
}

/* ===================
   SHIPPING BAR
   =================== */
#nahr-mini-cart .nahr-shipping-bar,
.nahr-page-shipping-bar {
    padding: 16px 20px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%) !important;
    border-bottom: 1px solid #e8e5e0 !important;
}

.nahr-page-shipping-bar {
    padding: 20px 25px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
    border: 1px solid #e8e5e0 !important;
}

#nahr-mini-cart .nahr-shipping-text,
.nahr-page-shipping-bar .nahr-shipping-text {
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: #333 !important;
    text-align: center !important;
    background: transparent !important;
}

.nahr-page-shipping-bar .nahr-shipping-text {
    font-size: 15px !important;
    margin-bottom: 12px !important;
}

#nahr-mini-cart .nahr-shipping-text.nahr-shipping-free,
.nahr-shipping-text.nahr-shipping-free {
    color: #28a745 !important;
    font-weight: 600 !important;
}

#nahr-mini-cart .nahr-shipping-progress,
.nahr-page-shipping-bar .nahr-shipping-progress {
    height: 6px !important;
    background: #e0e0e0 !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nahr-page-shipping-bar .nahr-shipping-progress {
    height: 10px !important;
    border-radius: 5px !important;
}

#nahr-mini-cart .nahr-shipping-progress-bar,
.nahr-shipping-progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #d4a15d 0%, #c4914d 100%) !important;
    border-radius: 3px !important;
    transition: width 0.5s ease !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===================
   CART ITEMS
   =================== */
#nahr-mini-cart .nahr-cart-items {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
}

#nahr-mini-cart .nahr-cart-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e8e5e0 !important;
    background: #ffffff !important;
    transition: background 0.3s ease !important;
    list-style: none !important;
}

#nahr-mini-cart .nahr-cart-item:hover {
    background: #f8f6f3 !important;
}

#nahr-mini-cart .nahr-cart-item:last-child {
    border-bottom: none !important;
}

#nahr-mini-cart .nahr-cart-item-image {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    border: 1px solid #e8e5e0 !important;
    display: block !important;
}

#nahr-mini-cart .nahr-cart-item-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

#nahr-mini-cart .nahr-cart-item-details {
    flex: 1 !important;
    min-width: 0 !important;
}

#nahr-mini-cart .nahr-cart-item-name {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
}

#nahr-mini-cart .nahr-cart-item-name:hover {
    color: #d4a15d !important;
}

#nahr-mini-cart .nahr-cart-item-qty {
    font-size: 13px !important;
    color: #666 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#nahr-mini-cart .nahr-cart-item-remove {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    background: transparent !important;
    border: 1px solid #e8e5e0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 16px !important;
    color: #bbb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

#nahr-mini-cart .nahr-cart-item-remove:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* ===================
   CART EMPTY
   =================== */
#nahr-mini-cart .nahr-cart-empty {
    padding: 50px 30px !important;
    text-align: center !important;
    background: #ffffff !important;
}

#nahr-mini-cart .nahr-cart-empty svg {
    width: 60px !important;
    height: 60px !important;
    color: #ddd !important;
    stroke: #ddd !important;
    margin: 0 auto 20px !important;
    display: block !important;
}

#nahr-mini-cart .nahr-cart-empty p {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    color: #666 !important;
    background: transparent !important;
}

#nahr-mini-cart .nahr-btn-shop {
    display: inline-block !important;
    padding: 12px 28px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #d4a15d 0%, #c4914d 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

#nahr-mini-cart .nahr-btn-shop:hover {
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(212, 161, 93, 0.4) !important;
}

/* ===================
   CART FOOTER
   =================== */
#nahr-mini-cart .nahr-cart-footer {
    padding: 20px !important;
    margin: 0 !important;
    background: #f8f6f3 !important;
    border-top: 1px solid #e8e5e0 !important;
}

#nahr-mini-cart .nahr-cart-subtotal {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
}

#nahr-mini-cart .nahr-cart-subtotal span:first-child {
    color: #666 !important;
}

#nahr-mini-cart .nahr-cart-total-amount {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

#nahr-mini-cart .nahr-cart-buttons {
    display: flex !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#nahr-mini-cart .nahr-btn-cart,
#nahr-mini-cart .nahr-btn-checkout {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

#nahr-mini-cart .nahr-btn-cart {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 2px solid #e8e5e0 !important;
}

#nahr-mini-cart .nahr-btn-cart:hover {
    border-color: #d4a15d !important;
    color: #d4a15d !important;
    background: #ffffff !important;
}

#nahr-mini-cart .nahr-btn-checkout {
    background: linear-gradient(135deg, #d4a15d 0%, #c4914d 100%) !important;
    color: white !important;
    border: none !important;
}

#nahr-mini-cart .nahr-btn-checkout:hover {
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(212, 161, 93, 0.4) !important;
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 480px) {
    #nahr-mini-cart.nahr-mini-cart {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    #nahr-mini-cart .nahr-mini-cart-toggle {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;
    }
    
    #nahr-mini-cart .nahr-mini-cart-toggle svg {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
    }
    
    #nahr-mini-cart .nahr-mini-cart-dropdown {
        width: calc(100vw - 40px) !important;
        max-width: 360px !important;
        right: -10px !important;
    }
    
    #nahr-mini-cart .nahr-cart-buttons {
        flex-direction: column !important;
    }
}

/* ===================
   ANIMATIONS
   =================== */
@keyframes nahrCartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

#nahr-mini-cart .nahr-cart-count.nahr-bounce {
    animation: nahrCartBounce 0.4s ease !important;
}

@keyframes nahrSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#nahr-mini-cart .nahr-cart-item {
    animation: nahrSlideIn 0.3s ease !important;
}

/* ===================
   WOOCOMMERCE BUTTON OVERRIDES
   =================== */
.woocommerce .button.add_to_cart_button,
.woocommerce .button.product_type_simple,
.woocommerce .single_add_to_cart_button {
    background: linear-gradient(135deg, #d4a15d 0%, #c4914d 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 28px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.woocommerce .button.add_to_cart_button:hover,
.woocommerce .button.product_type_simple:hover,
.woocommerce .single_add_to_cart_button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(212, 161, 93, 0.4) !important;
    color: white !important;
}

.woocommerce a.added_to_cart {
    color: #d4a15d !important;
    font-weight: 500 !important;
}

.woocommerce a.added_to_cart::before {
    content: '✓ ' !important;
}
