/**
 * CRITICAL DRTV AD CAMPAIGN - Cart/Checkout UX Improvements
 * Custom styles for View Cart buttons, Continue Shopping buttons, and cart icon
 * Last updated: December 3, 2025
 */

/* ============================================================================
   HEADER CART ICON
   ============================================================================ */

.header-cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px 0px;
    padding-right: 12px;
    transform: translateX(-10px);
    margin-left: 6px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.header-cart-link:hover,
.header-cart-link:focus {
    opacity: 0.7;
}

.header-cart-icon {
    width: 24px;
    height: 24px;
}

.header-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #1CABE2;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 4px;
    line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .header-cart-link {
        position: absolute;
        left: -3rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .header-cart-link svg {
        fill: #fff !important;
    }
}

@media (max-width: 700px) {
    .header-cart-link {
        left: 95%;
    }
}

@media (max-width: 400px) {
    .header-cart-link {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-cart-link {
        padding: 6px 10px;
    }
    
    .header-cart-icon {
        width: 20px;
        height: 20px;
    }
    
    .header-cart-count {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

/* ============================================================================
   VIEW CART BUTTONS
   ============================================================================ */

.unicef-view-cart-wrapper {
    margin-top: 15px;
}

/* Product page View Cart button - match Add to Cart styling */
.woocommerce div.product form.cart .unicef-view-cart-button,
.unicef-view-cart-button,
.button.unicef-view-cart-button,
a.button.unicef-view-cart-button {
    opacity: 1 !important;
    background: #e9e6ed !important;
    font-size: 16px !important;
    border-radius: 2px !important;
    padding: 6.888px 16px !important;
    color: #515151 !important;
    vertical-align: middle;
    float: left;
    margin-left: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    display: inline-block;
    width: auto;
}

.woocommerce div.product form.cart .unicef-view-cart-button:hover,
.woocommerce div.product form.cart .unicef-view-cart-button:focus,
.unicef-view-cart-button:hover,
.unicef-view-cart-button:focus,
.button.unicef-view-cart-button:hover,
.button.unicef-view-cart-button:focus,
a.button.unicef-view-cart-button:hover,
a.button.unicef-view-cart-button:focus {
    padding: 9.888px 40px 9.888px 16px !important;
    background: #E2231A !important;
    border-color: #E2231A !important;
    color: #fff !important;
    transform: scale(1.05);
}



/* Homepage View Cart section */
.unicef-home-view-cart {
    padding: 20px 0;
    text-align: center;
}

.unicef-home-view-cart .button {
    min-width: 200px;
}

/* ============================================================================
   CONTINUE SHOPPING BUTTONS
   ============================================================================ */

.unicef-continue-shopping {
    background: #e9e6ed !important;
    /* border: 2px solid #e9e6ed !important; */
    color: #515151 !important;
    transition: background-color 0.3s ease;
}

.unicef-continue-shopping:hover,
.unicef-continue-shopping:focus {
    background: #E2231A !important;
    border-color: #E2231A !important;
    color: #fff !important;
}

/* Cart actions (View Cart + Continue Shopping) */
.woocommerce-message .button.unicef-continue-shopping {
    margin-left: 10px;
}

@media (max-width: 600px) {
    .woocommerce-message .button.unicef-continue-shopping {
        margin-left: 0;
        margin-top: 10px;
        display: block;
    }
}

@media (max-width: 560px) {
    .unicef-checkout-continue-shopping a {
        width: 100%;
    }
}

/* Checkout Continue Shopping */
.unicef-checkout-continue-shopping {
    margin-bottom: 20px;
}

/* ============================================================================
   WOOCOMMERCE MESSAGE ADJUSTMENTS
   ============================================================================ */

.woocommerce-message {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.woocommerce-message .unicef-cart-actions {
    margin-top: 10px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 600px) {
    .unicef-cart-actions {
        flex-direction: column;
    }
    
    .unicef-cart-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .unicef-home-view-cart .button {
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================================================
   PAYMENT BUTTON HIDING (Belt and suspenders approach)
   ============================================================================ */

/* Hide payment request buttons on product pages */
.single-product .wc-stripe-payment-request-wrapper,
.single-product .wc-stripe-payment-request-button-separator,
.single-product .payment-request-button,
.single-product #payment-request-button,
.single-product .gpay-button,
.single-product .apple-pay-button,
.product .wc-stripe-payment-request-wrapper,
.product .wc-stripe-payment-request-button-separator,
.product .payment-request-button,
.product #payment-request-button,
.product .gpay-button,
.product .apple-pay-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Ensure these remain visible on cart and checkout */
.woocommerce-cart .wc-stripe-payment-request-wrapper,
.woocommerce-checkout .wc-stripe-payment-request-wrapper,
.woocommerce-cart .payment-request-button,
.woocommerce-checkout .payment-request-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}
