/**
 * Punisher Logic Styles
 * Requirement 2: Strictly hide quantity UI.
 * Requirement 9: Hide loading state by default.
 */

/* Force hide quantity inputs everywhere */
.woocommerce .quantity, 
.woocommerce-page .quantity,
.product-quantity input.qty,
.cart .quantity,
div.quantity {
    display: none !important;
}

/* Ensure our static "1" looks okay in cart */
.punisher-qty-1 {
    display: inline-block;
    padding: 8px 12px;
    background: var(--panel-2, #0e1318);
    border: 1px solid var(--line, #202833);
    border-radius: 8px;
    color: var(--ink, #d4d9df);
    font-weight: 600;
}

/* Requirement 9: Custom Order Page Loader */
/* Hide the specific loader elements used in the theme */
.tarkov-loader {
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Only show when strictly active */
.tarkov-loader.is-active-strict {
    display: flex !important;
    opacity: 1;
}

/* Remove From Cart Button Style */
.remove_from_cart_button {
    background: linear-gradient(135deg, #2a2f36, #1a1d23) !important;
    color: #ff5a5a !important; /* Red text for remove */
    border-color: #ff5a5a !important;
}

.remove_from_cart_button:hover {
    background: #ff5a5a !important;
    color: #fff !important;
    border-color: #ff5a5a !important;
}

/* =========================================
   LOOP BUTTONS LAYOUT (NEW)
   ========================================= */
/* Container for the two buttons (Remove + View Cart) */
/* We target standard shop loops AND single product pages only */
.woocommerce-shop .punisher-loop-buttons,
.woocommerce-archive .punisher-loop-buttons,
.single-product .punisher-loop-buttons,
.single-product .punisher-single-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    margin-top: 15px; 
    width: 100%;
}

/* Button styles - Scoped to avoid breaking Home Page */
/* We assume Home page is .home or .front-page and does NOT have .woocommerce-shop usually, 
   but if it uses shortcodes, we need to be careful.
   The user explicitly wants Home Page RESET.
   So we exclude .home from these aggressive styles.
*/
.punisher-loop-buttons .button,
.punisher-single-buttons .button,
/* Added Global Fallback for Shop Page if Wrapper is Missing */
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button,
.post-type-archive-product ul.products li.product .button,
.tax-product_cat ul.products li.product .button,
.archive .woocommerce ul.products li.product .button,
.add_to_cart_button,
.woocommerce .button,
.woocommerce-page .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .wc-forward,
.woocommerce .checkout-button,
.woocommerce .button.alt,
.woocommerce button.alt,
.woocommerce input.alt {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 14px; 
    padding: 14px 20px !important; 
    border-radius: 12px;
    line-height: 1.2;
    min-height: 50px; 
    display: flex !important;
    align-items: center;
    text-transform: uppercase; 
    font-weight: 700 !important; 
    box-sizing: border-box; /* Ensure padding doesn't explode width */
    background: transparent !important; 
    color: #d4d9df !important; 
    border: 1px solid #3a414b !important;
    margin-top: 10px !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

/* Ensure Hover works on Shop Page */
.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover,
.post-type-archive-product ul.products li.product .button:hover,
.tax-product_cat ul.products li.product .button:hover,
.add_to_cart_button:hover,
.woocommerce .button:hover,
.woocommerce-page .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .button.alt:hover,
.woocommerce button.alt:hover,
.woocommerce input.alt:hover,
.ptn-remove-btn:hover {
    background: #121820 !important;
    color: #fff !important;
    border-color: #c7b06a !important;
    box-shadow: 0 0 15px rgba(199, 176, 106, 0.2) !important;
}

/* Specific Fix for View Cart Button Visibility & Style Matching */
.punisher-loop-buttons .punisher-view-cart-btn,
.punisher-single-buttons .punisher-view-cart-btn {
    display: flex !important; 
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: 1px solid #3a414b !important;
    color: #d4d9df !important;
    text-transform: uppercase;
    font-weight: 700 !important;
    margin-top: 0 !important; 
    padding: 16px 20px !important; 
    min-height: 50px; 
    box-sizing: border-box;
}

/* EXCEPTION: Force REMOVE button to be gold/black only on Shop/Product pages, NOT Home */
.ptn-remove-btn {
    background: transparent !important; 
    color: #d4d9df !important; 
    border: 1px solid #3a414b !important; 
    text-transform: uppercase; 
    font-weight: bold;
}

.punisher-loop-buttons .punisher-view-cart-btn:hover,
.punisher-single-buttons .punisher-view-cart-btn:hover {
    background: #121820 !important;
    border-color: #c7b06a !important;
    color: #fff !important;
}

/* Hover for standard buttons */
.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover,
.add_to_cart_button:hover,
.woocommerce .button:hover,
.woocommerce-page .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .button.alt:hover,
.woocommerce button.alt:hover,
.woocommerce input.alt:hover,
.ptn-remove-btn:hover {
    background: #121820 !important;
    color: #fff !important;
    border-color: #c7b06a !important;
}

/* =========================================
   LOGIN MODAL STYLES
   ========================================= */
.ptn-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ptn-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ptn-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 17, 0.85);
    backdrop-filter: blur(5px);
}

.ptn-modal-content {
    position: relative;
    background: var(--panel, #12161b);
    border: 1px solid var(--line, #2a2f36);
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.ptn-modal.is-active .ptn-modal-content {
    transform: translateY(0);
}

.ptn-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--muted, #99a2ad);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.ptn-modal-close:hover {
    color: var(--ink, #fff);
}

.ptn-modal-header h3 {
    margin: 0 0 15px 0;
    color: var(--gold, #c7b06a);
    font-size: 24px;
    text-transform: uppercase;
}

.ptn-modal-body p {
    color: var(--ink, #d4d9df);
    margin-bottom: 25px;
    line-height: 1.5;
}

.ptn-modal-actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 16px;
    padding: 14px;
}

/* =========================================
   NOTICE / ERROR TOASTS FIX
   ========================================= */
/* Move Woo notices out of the grid and into a fixed toast position */
.woocommerce-error, 
.woocommerce-message, 
.woocommerce-info,
.woocommerce-store-notice {
    position: fixed !important;
    top: auto !important; 
    bottom: auto !important; 
    left: auto !important; 
    right: 20px !important;
    transform: none !important;
    z-index: 9999999 !important;
    width: auto !important;
    min-width: 300px !important;
    max-width: 400px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
    animation: slideInBottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
    border-radius: 8px !important;
    padding-right: 40px !important; 
    margin: 0 !important;
    height: auto !important;
    min-height: auto !important;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure they look good */
.woocommerce-error {
    background: #2a1515 !important;
    border-color: #ff5a5a !important;
    color: #ff5a5a !important;
}

.woocommerce-message {
    background: #152a1a !important;
    border-color: #79d27a !important;
    color: #79d27a !important;
}

/* Coupon info and other info messages */
.woocommerce-info {
    background: #15202a !important;
    border-color: #00f5ff !important;
    color: #00f5ff !important;
}

/* Ensure links in messages are visible */
.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: #fff !important;
    text-decoration: underline !important;
    font-weight: bold !important;
    margin-left: 10px !important;
}

/* Button inside message (View Cart) */
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
    float: right !important;
    background: transparent !important;
    border: 1px solid #fff !important;
    color: #fff !important;
    padding: 5px 10px !important;
    margin-left: 15px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.woocommerce-message .button:hover,
.woocommerce-info .button:hover {
    background: #fff !important;
    color: #000 !important;
}

.cart-empty {
    padding-right: 40px !important; /* Make room for X button */
}

/* Close Button Style */
.ptn-notice-close {
    position: absolute !important;
    top: 50% !important;
    right: 15px !important;
    transform: translateY(-50%) !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    text-align: center !important;
    cursor: pointer !important;
    opacity: 0.8 !important;
    font-weight: bold !important;
    font-family: sans-serif !important;
    z-index: 100000 !important;
    color: #fff !important; /* Force white for visibility */
    background: rgba(0,0,0,0.3) !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.ptn-notice-close:hover {
    opacity: 1 !important;
    background: #ff5a5a !important;
    transform: translateY(-50%) scale(1.1) !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* =========================================
   CHECKOUT FIELD CLEANUP
   ========================================= */
/* Ensure Country Dropdown is Clean & Visible */
.woocommerce-checkout #billing_country_field {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
}

/* Fix Dropdown Height/Style */
.select2-container .select2-selection--single {
    height: 50px !important;
    background: var(--panel-2, #0e1318) !important;
    border: 1px solid var(--line, #2a2f36) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ink, #e0e0e0) !important;
    line-height: normal !important;
    padding-left: 16px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    top: 1px !important;
    right: 10px !important;
}

/* Fix Full Width for Twitch Field */
#billing_twitch_identity_field {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Hide First/Last Name if they somehow persist via other plugins */
#billing_first_name_field,
#billing_last_name_field {
    display: none !important;
}
