/**
 * Checkout Coupon Section Styling
 * 
 * Modern styling for the coupon section on checkout/registration pages
 * 
 * @package Ethos
 */

/* ==========================================================================
   Coupon Section Container
   ========================================================================== */

.ihc-checkout-page-box-extra-options {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%) !important;
    border: 2px solid #eae9f3 !important;
    border-radius: 12px !important;
    padding: 30px !important;
    margin: 20px 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    font-family: 'Poppins', sans-serif !important;
}

/* ==========================================================================
   Coupon Toggle Button
   ========================================================================== */

.ihc-checkout-page-box-extra-options > a,
.ihc-checkout-page-box-extra-options > button,
.ihc-checkout-page-box-extra-options .ihc-coupon-toggle {
    background: transparent !important;
    border: none !important;
    color: #181818 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    padding: 12px 0 !important;
    margin: 0 0 20px 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: color 0.3s ease !important;
    width: 100% !important;
    text-align: left !important;
}

.ihc-checkout-page-box-extra-options > a:hover,
.ihc-checkout-page-box-extra-options > button:hover,
.ihc-checkout-page-box-extra-options .ihc-coupon-toggle:hover {
    color: var(--primary-color) !important;
}

/* Remove duplicate arrows - button already has ▲ in text */
.ihc-checkout-page-box-extra-options > a::after,
.ihc-checkout-page-box-extra-options > button::after,
.ihc-checkout-page-box-extra-options .ethos-coupon-section-toggle::after {
    content: none !important;
    display: none !important;
}

/* Style the arrow that's already in the button text */
.ihc-checkout-page-box-extra-options > button,
.ihc-checkout-page-box-extra-options .ethos-coupon-section-toggle {
    position: relative !important;
}

/* If toggle contains ▲, it means it's expanded */
.ihc-checkout-page-box-extra-options > button:contains('▲'),
.ihc-checkout-page-box-extra-options .ethos-coupon-section-toggle[aria-expanded="true"] {
    color: var(--primary-color) !important;
}

/* ==========================================================================
   Coupon Wrapper
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-discount-wrapper {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eae9f3 !important;
}

/* ==========================================================================
   Coupon Description Text
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-checkout-page-additional-info {
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
    margin-bottom: 15px !important;
    font-family: 'Poppins', sans-serif !important;
}

/* ==========================================================================
   Coupon Input Container and Field
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-checkout-page-input-left {
    width: calc(70% - 10px) !important;
    float: left !important;
    padding-right: 10px !important;
    margin-bottom: 15px !important;
    box-sizing: border-box !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-input,
.ihc-checkout-page-box-extra-options .ihc-checkout-page-input-left input[type="text"],
.ihc-checkout-page-box-extra-options input[name="ihc-discount"],
.ihc-checkout-page-box-extra-options #ihc-discount {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #eae9f3 !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-family: 'Poppins', sans-serif !important;
    color: #181818 !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    min-height: 44px !important;
    outline: none !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-input:focus,
.ihc-checkout-page-box-extra-options .ihc-checkout-page-input-left input[type="text"]:focus,
.ihc-checkout-page-box-extra-options input[name="ihc-discount"]:focus {
    outline: none !important;
    border-color: #e9463b !important;
    box-shadow: 0 0 0 3px rgba(233, 70, 59, 0.1) !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-input::placeholder,
.ihc-checkout-page-box-extra-options input[name="ihc-discount"]::placeholder {
    color: #b5b5b5 !important;
    font-style: italic !important;
}

/* ==========================================================================
   Apply Coupon Button Container and Button
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply-right {
    width: 30% !important;
    float: right !important;
    box-sizing: border-box !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply,
.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply-right button[type="submit"],
.ihc-checkout-page-box-extra-options button[name="ihc-apply-discount"],
.ihc-checkout-page-box-extra-options #ihc-apply-discount {
    width: 100% !important;
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: 'Poppins', sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: 0 2px 8px rgba(233, 70, 59, 0.3) !important;
    line-height: 1.5 !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply:hover,
.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply-right button[type="submit"]:hover,
.ihc-checkout-page-box-extra-options button[name="ihc-apply-discount"]:hover {
    background: #cc3c32 !important;
    background-color: #cc3c32 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(233, 70, 59, 0.4) !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply:active,
.ihc-checkout-page-box-extra-options .ihc-checkout-page-apply-right button[type="submit"]:active {
    transform: translateY(0) !important;
}

/* Clear float */
.ihc-checkout-page-box-extra-options .ihc-clear {
    clear: both !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   Applied Coupon Display
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-checkout-page-used {
    width: 100% !important;
    padding: 15px 0 !important;
    margin: 15px 0 0 0 !important;
    clear: both !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    min-height: auto !important;
    height: auto !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-used-label {
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    margin: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-used-code {
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    color: #155724 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    display: inline-block !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    word-break: keep-all !important;
}

/* Remove coupon link/button */
.ihc-checkout-page-box-extra-options .ihc-checkout-page-used-remove,
.ihc-checkout-page-box-extra-options .ihc-js-checkout-page-do-remove-coupon,
.ihc-checkout-page-box-extra-options a[href*="remove"] {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 4px !important;
    background: transparent !important;
    transition: all 0.3s ease !important;
    font-family: 'Poppins', sans-serif !important;
    cursor: pointer !important;
    display: inline-block !important;
}

.ihc-checkout-page-box-extra-options .ihc-checkout-page-used-remove:hover,
.ihc-checkout-page-box-extra-options .ihc-js-checkout-page-do-remove-coupon:hover,
.ihc-checkout-page-box-extra-options a[href*="remove"]:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
}

/* ==========================================================================
   Coupon Error Messages
   ========================================================================== */

.ihc-checkout-page-box-extra-options .ihc-coupon-error,
.ihc-checkout-page-box-extra-options .ihc-error-message {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    margin: 15px 0 !important;
    color: #721c24 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Poppins', sans-serif !important;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

.ihc-checkout-page-box-extra-options #ihc-discount-error-wrap,
.ihc-checkout-page-box-extra-options .ihc-checkout-alert {
    width: 100% !important;
    clear: both !important;
    margin-top: 15px !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: 'Poppins', sans-serif !important;
}

.ihc-checkout-page-box-extra-options #ihc-discount-error-wrap.ihc-checkout-alert {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ihc-checkout-page-box-extra-options {
        padding: 20px !important;
        margin: 15px 0 !important;
    }
    
    .ihc-checkout-page-box-extra-options input[type="submit"],
    .ihc-checkout-page-box-extra-options button[type="submit"] {
        width: 100% !important;
    }
}

