/* --- FILE: assets/css/frontend-styles.css --- */

/*
 * Styles for the custom "Subscribe" button on shop pages.
 */

/* Force both buttons to align correctly */
.woocommerce ul.products li.product .button {
    margin-top: 0.5em;
}

/* 
 * Apply the EXACT theme styles directly to OUR button class.
 * This ensures it perfectly matches the "Add to Cart" button.
 */
.phia-subscribe-button {
    /* 1. KEY FIX: Allows margins and padding to work correctly */
    display: inline-block !important; 
    
    background-color: transparent !important;
    color: #9e8844 !important;
    border: 2px solid #9e8844 !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 10px ;
    font-weight: 300 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    transition: all 0.3s ease;
    
    margin-left: 4px !important;
    
    /* 2. KEY FIX: Added !important to force the top space */
    margin-top: 10px !important; 
}

/* Apply a matching hover effect */
.phia-subscribe-button:hover {
    background-color: #9e8844 !important;
    color: #fff !important;
}

/*
 * Styles for the Subscription Pop-up Modal
 */

.phia-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phia-popup-container {
    font-family: 'Raleway', sans-serif;
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    position: relative;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.phia-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #9e8844 !important; /* Force Dark Gray */
    text-decoration: none !important; /* Force removal of underline */
    line-height: 1;
    transition: color 0.3s ease;
}

.phia-popup-close:hover {
    color: #d2b55b !important; /* Change to your Theme Gold on hover */
    text-decoration: none !important;
}

/* Simple loader animation */
.phia-popup-content .loader {
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*
 * Styles for content dynamically loaded into the popup
 */
.phia-popup-content h2 {
    color: #9e8844;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.phia-popup-content h3 {
    text-align: center;
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: normal;
}

.plan-option {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.plan-option input[type="radio"] {
    margin-right: 10px;
}


/* --- REPLACED CODE STARTS HERE --- */
/*
 * Styles for the Action Buttons inside the popup
 */
.popup-actions {
    margin-top: 25px;
    text-align: center;
    /* Use Flexbox for perfect alignment */
    display: flex;
    justify-content: center;
    gap: 10px;
    /* This creates a space between the buttons */
}

/* Style the buttons to look like your theme's buttons */
.popup-actions .button {
    background-color: transparent !important;
    color: #9e8844 !important;
    border: 2px solid #9e8844 !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    transition: all 0.3s ease;
    line-height: 1;
    /* Add this for better vertical alignment */
    margin: 0;
    /* Override default margin */
}

/* Add a matching hover effect */
.popup-actions .button:hover {
    background-color: #9e8844 !important;
    color: #fff !important;
}

/* Style for disabled buttons */
.popup-actions .button.disabled {
    opacity: 0.5;
    pointer-events: none;
    /* Prevents clicking */
}

/* --- REPLACED CODE ENDS HERE --- */


/*
 * Styles for the Plan Details Box inside the popup
 */

.plan-details-box {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.plan-details-box p {
    margin: 5px 0;
    font-size: 1em;
}

.plan-details-box .discount-line {
    color: #2a7a2a;
    font-size: 1.1em;
}

.plan-details-box .annual-cost {
    color: #9E8844;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
/* 
 * =============================================================
 * CUSTOM THEME FIX: Subscribe Ribbon Badge
 * =============================================================
 */

/* 1. PREPARE THE PARENT CARD (Your Theme's Specific Class) */
/* We set position:relative so the ribbon anchors to the White Card, not the page. */
/* We set overflow:hidden so the ribbon cuts off cleanly at the rounded corners. */
.shop-wraper .product-wrap {
    position: relative !important;
    overflow: hidden !important;
    /* Ensure the padding doesn't push the absolute ribbon */
    z-index: 1; 
}

/* 2. THE RIBBON STYLE */
.phia-ribbon-badge {
    position: absolute;
    
    /* POSITIONING: Sticks it to the top-left of the WHITE CARD */
    top: 15px; 
    left: -30px; 
    
    /* SHAPE & SIZE */
    width: 120px;
    height: 28px;
    
    /* TEXT STYLING */
    line-height: 28px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    
    /* COLOR */
    background-color: #a00000;
    color: #fff !important;
    
    /* ROTATION (45 degrees) */
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    
    /* VISIBILITY FORCE */
    z-index: 10; /* Sit on top of the product image */
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    
    /* SHADOW */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    
    /* RESET THEME DEFAULTS */
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    pointer-events: none;
}
/* 
 * =============================================================
 * FIX: Single Product Page Button Alignment
 * =============================================================
 */

/* 1. Turn the Cart Form into a Flexbox container */
/* This forces the Quantity Input, Add to Cart, and Subscribe button to align perfectly */
.woocommerce div.product form.cart {
    display: flex !important;
    align-items: center !important; /* Vertically centers all buttons */
    flex-wrap: wrap !important;     /* Allows wrapping on mobile */
    gap: 10px !important;           /* Consistent space between elements */
}

/* 2. Override styles specifically for the Product Page Subscribe Button */
.woocommerce div.product .phia-subscribe-button {
    /* RESET: Remove the top margin that is used on the Shop Page */
    margin-top: 0 !important; 
    margin-left: 0 !important; /* Gap is handled by the flexbox gap above */
    
    /* MATCH THEME: Copy exact padding and font from your "Add to Cart" button */
    padding: 10px 15px !important; 
    font-size: 10px !important; 
    font-weight: 600 !important;

    border: 2px solid #9e8844 !important;
    border-radius: 8px !important;
    
    /* HEIGHT FIX: Ensure it stands as tall as the Add to Cart button */
    line-height: normal !important; 
    height: auto !important;
    display: inline-block !important;
}

.woocommerce div.product .phia-subscribe-button:hover {
    background-color: #9e8844 !important;
    color: #fff !important;
}