/**
 * Advanced Coupons - Frontend Styles
 * 
 * Consolidated CSS for all frontend features.
 * Following WooCommerce styling guidelines.
 *
 * @package AdvancedCoupons
 * @since 1.0.0
 */

/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
    /* 
     * Design Tokens - Minimal set, inherits from WordPress/WooCommerce
     * Only define what we actually use, prefer native WP variables
     */
    
    /* Primary - WooCommerce purple */
    --acfw-primary: var(--wp--preset--color--primary, #7f54b3);
    --acfw-primary-hover: #6b4799;
    
    /* Text & Background */
    --acfw-text: var(--wp--preset--color--contrast, #1e1e1e);
    --acfw-text-muted: #646970;
    --acfw-bg: #f8f9fa;
    --acfw-bg-white: #ffffff;
    
    /* Borders */
    --acfw-border: #d3ced2;
    --acfw-border-light: #e5e7eb;
    
    /* Status Colors */
    --acfw-success: #10b981;
    --acfw-error: #dc3232;
    
    /* Spacing Scale */
    --acfw-space-xs: 4px;
    --acfw-space-sm: 8px;
    --acfw-space-md: 12px;
    --acfw-space-lg: 16px;
    --acfw-space-xl: 20px;
    
    /* Border Radius */
    --acfw-radius-sm: 4px;
    --acfw-radius-md: 6px;
    --acfw-radius-lg: 8px;
    
}

/* Hidden by default - shown via JS */
.acfw-hidden {
    display: none;
}

/* Gift Certificate Delivery Date */
.acfw-gc-delivery-date {
    margin-top: 10px;
}
    /* Transition */
    --acfw-transition: 0.2s ease;
}

/* ==========================================================================
   2. BASE STYLES - Shared Components
   ========================================================================== */

/* Form Inputs */
.acfw-form input[type="text"],
.acfw-form input[type="email"],
.acfw-form input[type="number"],
.acfw-form input[type="date"],
.acfw-form textarea,
.acfw-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--acfw-text);
    background: var(--acfw-bg-white);
    border: 1px solid var(--acfw-border);
    border-radius: var(--acfw-radius-md);
    transition: border-color var(--acfw-transition), box-shadow var(--acfw-transition);
}

.acfw-form input:focus,
.acfw-form textarea:focus,
.acfw-input:focus {
    outline: none;
    border-color: var(--acfw-primary);
    box-shadow: 0 0 0 1px var(--acfw-primary);
}

.acfw-form input.error,
.acfw-input.error {
    border-color: var(--acfw-error);
}

.acfw-form textarea {
    min-height: 80px;
    resize: vertical;
}

.acfw-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--acfw-text);
}

.acfw-form .required {
    color: var(--acfw-error);
}

/* Buttons */
.acfw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: var(--acfw-primary);
    border: none;
    border-radius: var(--acfw-radius-md);
    cursor: pointer;
    transition: background var(--acfw-transition);
}

.acfw-btn:hover {
    background: var(--acfw-primary-hover);
}

.acfw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.acfw-btn--secondary {
    background: #96588a;
}

.acfw-btn--secondary:hover {
    background: #7d4a74;
}

.acfw-btn--outline {
    color: var(--acfw-primary);
    background: transparent;
    border: 1px solid var(--acfw-primary);
}

.acfw-btn--outline:hover {
    color: #fff;
    background: var(--acfw-primary);
}

.acfw-btn--danger {
    background: var(--acfw-error);
}

.acfw-btn--small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards/Boxes */
.acfw-card {
    margin: 20px 0;
    padding: 20px;
    background: var(--acfw-bg);
    border: 1px solid var(--acfw-border-light);
    border-radius: var(--acfw-radius-lg);
}

.acfw-card--white {
    background: var(--acfw-bg-white);
}

.acfw-card__title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 700;
    color: var(--acfw-text);
}

/* Form Row */
.acfw-form-row {
    margin-bottom: 15px;
}

.acfw-form-row:last-child {
    margin-bottom: 0;
}

/* Hint/Help Text */
.acfw-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--acfw-text-muted);
}

/* Error Message */
.acfw-error-msg {
    color: var(--acfw-error);
    font-size: 13px;
    margin-top: 8px;
}

/* ==========================================================================
   3. AVAILABLE COUPONS
   ========================================================================== */

.acfw-available-coupons {
    margin: 20px 0;
    border: 1px solid var(--acfw-border-light);
    border-radius: var(--acfw-radius-lg);
    background: var(--acfw-bg-white);
    overflow: hidden;
}

/* Toggle Link - WooCommerce pattern (like shipping calculator) */
.acfw-coupons-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--acfw-primary, #7f54b3);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.acfw-coupons-toggle:hover {
    background: var(--acfw-primary-hover, #6b4799);
    color: #fff;
}

/* Child elements inherit color from parent (flexible for theme customization) */
.acfw-coupons-toggle .acfw-toggle-text,
.acfw-coupons-toggle .acfw-count {
    color: inherit;
}

.acfw-coupons-toggle .acfw-count {
    margin-left: 6px;
    opacity: 0.9;
}

.acfw-coupons-toggle::after {
    content: '';
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.acfw-coupons-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

/* Content */
.acfw-coupons-content {
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
}

/* Coupon List - Smart Auto-fit Grid */
.acfw-available-coupons .acfw-ac-list {
    display: grid;
    /* 
     * Smart responsive grid with container queries:
     * - min 240px per coupon (slightly smaller for better fit)
     * - auto-fit: fills row, wraps when not enough space
     * - 1fr: equal width columns
     * 
     * Breakpoints (approximate):
     * - < 500px container: 1 column
     * - 500px-740px container: 2 columns
     * - > 740px container: 3 columns
     */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    /* Align top - natural height, clean look */
    align-items: start;
    /* Enable container queries */
    container-type: inline-size;
}

/* Container query for narrow containers (sidebar) */
@container (max-width: 350px) {
    .acfw-available-coupons .acfw-ac-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .acfw-available-coupons .acfw-ac-list .acfw-coupon {
        width: 100%;
        min-width: auto;
    }
}

/* Block theme compatibility - higher specificity for narrow containers */
.wc-block-components-sidebar-layout .acfw-available-coupons .acfw-ac-list,
.wp-block-woocommerce-checkout-fields-block .acfw-available-coupons .acfw-ac-list,
.wp-block-woocommerce-cart .acfw-available-coupons .acfw-ac-list,
.woocommerce-checkout .acfw-available-coupons .acfw-ac-list,
.woocommerce-cart .acfw-available-coupons .acfw-ac-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Sidebar specific - single column */
.wc-block-components-sidebar .acfw-available-coupons .acfw-ac-list,
.woocommerce-checkout-review-order .acfw-available-coupons .acfw-ac-list {
    grid-template-columns: 1fr;
}

/* Coupon Card Wrapper - Click-to-Apply */
.acfw-ac-card-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--acfw-radius-lg, 14px);
    transition: transform 0.2s ease;
}

/* Keep coupon original design size */
.acfw-ac-card-wrapper .acfw-coupon {
    position: relative;
    transition: box-shadow 0.2s ease;
}

.acfw-ac-card-wrapper:hover {
    transform: translateY(-4px);
}

.acfw-ac-card-wrapper:hover .acfw-coupon {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.acfw-ac-card-wrapper:active {
    transform: translateY(-2px);
}

/* Click hint tooltip on hover */
.acfw-ac-card-wrapper::before {
    content: 'Click to apply';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

/* Tooltip arrow */
.acfw-ac-card-wrapper::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.acfw-ac-card-wrapper:hover::before,
.acfw-ac-card-wrapper:hover::after {
    opacity: 1;
    visibility: visible;
}

.acfw-ac-card-wrapper:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* Applying state - Loading */
.acfw-ac-card-wrapper.acfw-applying {
    pointer-events: none;
    opacity: 0.7;
}

.acfw-ac-card-wrapper.acfw-applying .acfw-coupon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid var(--acfw-primary, #7f54b3);
    border-top-color: transparent;
    border-radius: 50%;
    animation: acfw-spin 0.8s linear infinite;
    z-index: 20;
}

/* Hide tooltip when applying */
.acfw-ac-card-wrapper.acfw-applying::before,
.acfw-ac-card-wrapper.acfw-applying::after {
    display: none;
}

/* Applied state - Success overlay */
.acfw-ac-card-wrapper.acfw-applied {
    pointer-events: none;
}

.acfw-ac-card-wrapper.acfw-applied .acfw-coupon::after {
    content: '✓ Applied!';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: rgba(16, 185, 129, 0.95);
    border-radius: inherit;
    animation: acfw-success-overlay 0.3s ease forwards;
    z-index: 15;
}

@keyframes acfw-success-overlay {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hide tooltip when applied */
.acfw-ac-card-wrapper.acfw-applied::before,
.acfw-ac-card-wrapper.acfw-applied::after {
    display: none;
}

/* Empty State */
.acfw-ac-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    color: var(--acfw-text-muted);
    font-style: italic;
}

/* ==========================================================================
   3.1 MY ACCOUNT COUPONS PAGE
   ========================================================================== */

.acfw-myaccount-coupons {
    margin: 0;
}

.acfw-myaccount-section {
    margin-bottom: 30px;
}

.acfw-myaccount-section:last-child {
    margin-bottom: 0;
}

.acfw-myaccount-section h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--acfw-text);
    border-bottom: 1px solid var(--acfw-border-light);
}

.acfw-myaccount-coupons .acfw-ac-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.acfw-total-credit {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--acfw-radius-md);
    font-size: 14px;
    color: #065f46;
}

.acfw-total-credit strong {
    margin-right: 8px;
}

/* ==========================================================================
   4. STORE CREDIT
   ========================================================================== */

/* Balance Display */
.acfw-store-credit-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--acfw-radius-lg);
    margin-bottom: 15px;
}

.acfw-balance-label {
    font-size: 14px;
    color: #065f46;
}

.acfw-balance-amount {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
}

/* Store Credit Form - WooCommerce compatible */
.acfw-store-credit-form {
    margin: 20px 0;
    padding: 20px;
    background: var(--acfw-bg);
    border-radius: var(--acfw-radius-lg);
}

.acfw-store-credit-form.woocommerce-form {
    background: var(--wc-form-color-background, var(--acfw-bg));
}

.acfw-store-credit-form h4 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
}

/* Amount field using woocommerce_form_field */
.acfw-store-credit-form .acfw-amount-field {
    margin-top: 15px;
}

.acfw-store-credit-form .acfw-amount-field .input-text {
    max-width: 200px;
}

.acfw-store-credit-form .acfw-amount-hint {
    font-size: 12px;
    color: var(--acfw-text-muted);
    margin-top: 8px;
}

/* Preset Amounts */
.acfw-preset-amounts,
.acfw-amount-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.acfw-preset-btn,
.acfw-amount-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--acfw-text);
    background: var(--acfw-bg-white);
    border: 2px solid var(--acfw-border);
    border-radius: var(--acfw-radius-md);
    cursor: pointer;
    transition: all var(--acfw-transition);
}

.acfw-preset-btn:hover,
.acfw-amount-btn:hover {
    border-color: var(--acfw-primary);
    color: var(--acfw-primary);
}

.acfw-preset-btn.active,
.acfw-preset-btn.selected,
.acfw-amount-btn.active,
.acfw-amount-btn.selected {
    background: var(--acfw-primary);
    border-color: var(--acfw-primary);
    color: #fff;
}

/* Custom Amount */
.acfw-custom-amount,
.acfw-custom-amount-input {
    margin-top: 15px;
    padding: 15px;
    background: var(--acfw-bg-white);
    border: 1px solid var(--acfw-border);
    border-radius: var(--acfw-radius-md);
}

.acfw-amount-input-wrap {
    display: flex;
    align-items: center;
    max-width: 200px;
}

.acfw-currency {
    padding: 10px 12px;
    background: var(--acfw-bg);
    border: 1px solid var(--acfw-border);
    border-right: none;
    border-radius: var(--acfw-radius-md) 0 0 var(--acfw-radius-md);
    font-weight: 600;
}

.acfw-amount-input-wrap input {
    flex: 1;
    border-radius: 0 var(--acfw-radius-md) var(--acfw-radius-md) 0;
}

/* ==========================================================================
   5. GIFT CARD / GIFT CERTIFICATE
   ========================================================================== */

/* Gift Form Container - Using WooCommerce patterns */
.acfw-gift-card-form,
.acfw-gift-certificate-form,
.acfw-gift-certificate-container,
.acfw-gc-recipient-form {
    margin: 20px 0;
    padding: 20px;
    background: var(--acfw-bg);
    border: 1px solid var(--acfw-border-light);
    border-radius: var(--acfw-radius-lg);
}

/* Gift Certificate Form - WooCommerce compatible */
.acfw-gift-certificate-form.woocommerce-form {
    background: var(--wc-form-color-background, var(--acfw-bg));
}

.acfw-gift-certificate-form .form-row {
    margin-bottom: 15px;
}

.acfw-gift-certificate-form .input-text,
.acfw-gift-certificate-form .woocommerce-Input {
    /* Inherits WooCommerce styles automatically */
}

.acfw-gift-certificate-form .acfw-gc-help-text {
    font-size: 12px;
    color: var(--acfw-text-muted);
    margin: 8px 0 0;
}

.acfw-gift-certificate-form .acfw-gc-note {
    margin-top: 15px;
    color: var(--acfw-text-muted);
    font-style: italic;
}

.acfw-gift-certificate-form .acfw-gc-error {
    margin: 10px 0;
}

.acfw-gift-card-form h4,
.acfw-gc-recipient-form h3 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 700;
    color: var(--acfw-text);
}

/* Recipient Section */
.acfw-gift-card-recipient,
.acfw-gc-recipient-fields {
    margin-top: 20px;
    padding: 20px;
    background: var(--acfw-bg-white);
    border: 1px solid var(--acfw-border-light);
    border-radius: var(--acfw-radius-md);
}

/* Gift Toggle Options */
.acfw-gift-toggle,
.acfw-timing-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.acfw-toggle-option,
.acfw-timing-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: var(--acfw-bg-white);
    border: 2px solid var(--acfw-border);
    border-radius: var(--acfw-radius-lg);
    cursor: pointer;
    transition: all var(--acfw-transition);
    text-align: center;
}

.acfw-toggle-option:hover,
.acfw-timing-option:hover {
    border-color: var(--acfw-primary);
}

.acfw-toggle-option.active,
.acfw-timing-option.active {
    border-color: var(--acfw-primary);
    background: color-mix(in srgb, var(--acfw-primary) 5%, transparent);
}

.acfw-toggle-option input[type="radio"],
.acfw-timing-option input[type="radio"] {
    display: none;
}

.acfw-toggle-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.acfw-toggle-text {
    font-weight: 600;
    color: var(--acfw-text);
}

/* Schedule Delivery */
.acfw-gc-schedule-wrapper,
.acfw-delivery-timing {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--acfw-border-light);
}

/* Multiple Recipients - WooCommerce form patterns */
.acfw-recipient-row,
.acfw-gc-recipient-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--acfw-border-light);
}

.acfw-recipient-row:last-child,
.acfw-gc-recipient-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* WooCommerce form row layout for recipients */
.acfw-recipient-row.woocommerce-form {
    display: block;
}

.acfw-recipient-row .form-row {
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
}

.acfw-recipient-row .form-row-first {
    width: 48%;
    margin-right: 2%;
}

.acfw-recipient-row .form-row-last {
    width: 48%;
    position: relative;
}

.acfw-recipient-row .form-row-wide {
    width: 100%;
}

.acfw-recipient-row .acfw-amount-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.acfw-recipient-row .acfw-amount-row .input-text {
    flex: 1;
    max-width: 150px;
}

.acfw-recipient-row input.input-text,
.acfw-gc-recipient-item input {
    width: 100%;
}

.acfw-remove-recipient,
.acfw-gc-remove-recipient {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    background: var(--acfw-error);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.acfw-remove-recipient:hover,
.acfw-gc-remove-recipient:hover {
    background: #b91c1c;
}

.acfw-gc-add-recipient {
    margin-top: 10px;
}

/* Multiple Recipients Form - Responsive */
@media screen and (max-width: 600px) {
    .acfw-recipient-row .form-row-first,
    .acfw-recipient-row .form-row-last {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .acfw-recipient-row .acfw-amount-row {
        flex-wrap: wrap;
    }
    
    .acfw-recipient-row .acfw-amount-row .input-text {
        max-width: none;
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   6. IMAGE UPLOAD
   ========================================================================== */

.acfw-gift-image-upload {
    margin: 20px 0;
    padding: 20px;
    background: var(--acfw-bg);
    border: 1px solid var(--acfw-border-light);
    border-radius: var(--acfw-radius-lg);
}

.acfw-upload-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.acfw-image-preview {
    position: relative;
    margin-top: 15px;
    padding: 15px;
    background: var(--acfw-bg-white);
    border: 1px solid var(--acfw-border);
    border-radius: var(--acfw-radius-lg);
    text-align: center;
    max-width: 250px;
}

.acfw-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--acfw-radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.acfw-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: var(--acfw-error);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 26px;
    cursor: pointer;
}

/* Loading State */
.acfw-gift-image-upload.is-uploading .acfw-upload-btn {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes acfw-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   7. STORE NOTICE COUPON
   ========================================================================== */

/* Store Notice Bar - WooCommerce style */
.acfw-store-notice {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Position variants */
.acfw-store-notice.acfw-notice-top {
    position: relative;
    width: 100%;
}

.acfw-store-notice.acfw-notice-top-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
}

.acfw-store-notice.acfw-notice-bottom {
    position: relative;
    width: 100%;
}

.acfw-store-notice.acfw-notice-bottom-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
}

/* Style variants */
.acfw-store-notice.acfw-style-modern {
    background: linear-gradient(90deg, #00b4d8, #0077b6);
    color: #fff;
}

.acfw-store-notice.acfw-style-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.acfw-store-notice.acfw-style-minimal {
    background: #f8f9fa;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.acfw-store-notice.acfw-style-festive {
    background: linear-gradient(90deg, #c41e3a, #228b22);
    color: #fff;
}

/* Content */
.acfw-store-notice p {
    margin: 0;
    flex: 1;
    text-align: center;
}

.acfw-store-notice p a {
    color: inherit;
    text-decoration: underline;
    margin-left: 4px;
}

.acfw-store-notice p a:hover {
    opacity: 0.9;
}

/* Dismiss button - WooCommerce components-button style */
.acfw-store-notice .acfw-notice-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.1s linear;
}

.acfw-store-notice .acfw-notice-dismiss:hover {
    opacity: 1;
}

.acfw-store-notice .acfw-notice-dismiss svg {
    fill: currentColor;
}

/* Admin bar offset */
body.admin-bar .acfw-store-notice.acfw-notice-top-fixed {
    top: 32px;
}

/* Store Notice Responsive */
@media (max-width: 600px) {
    .acfw-store-notice {
        height: auto;
        min-height: 40px;
        padding: 8px 12px;
    }
    
    .acfw-store-notice p {
        font-size: 13px;
    }
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

/* 
 * Coupon grid uses auto-fit, no fixed breakpoints needed.
 * Grid automatically adjusts:
 * - Wide screen: 3+ coupons per row
 * - Medium: 2 coupons per row  
 * - Narrow: 1 coupon per row
 */

/* Small screens - ensure coupon fills available space */
@media screen and (max-width: 599px) {
    .acfw-ac-list {
        grid-template-columns: 1fr;
    }
    
    .acfw-ac-card-wrapper .acfw-coupon {
        width: 100%;
        min-width: unset;
    }
}

/* General mobile adjustments */
@media screen and (max-width: 768px) {
    .acfw-coupons-toggle {
        padding: 12px 15px;
    }
    
    .acfw-coupons-content {
        padding: 12px;
    }
    
    .acfw-gift-toggle,
    .acfw-timing-toggle {
        flex-direction: column;
    }
    
    .acfw-preset-amounts,
    .acfw-amount-options {
        justify-content: center;
    }
    
    .acfw-preset-btn,
    .acfw-amount-btn {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 60px;
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .acfw-upload-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .acfw-image-preview {
        max-width: 100%;
    }
    
    .acfw-coupon-amount {
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .acfw-preset-btn,
    .acfw-amount-btn {
        flex: 1 1 calc(50% - 10px);
    }
    
    .acfw-recipient-row,
    .acfw-gc-recipient-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .acfw-remove-recipient,
    .acfw-gc-remove-recipient {
        align-self: flex-end;
    }
}

/* ==========================================================================
   9. WOOCOMMERCE BLOCKS COMPATIBILITY
   ========================================================================== */

.wc-block-cart .acfw-available-coupons,
.wc-block-checkout .acfw-available-coupons {
    margin: 20px 0;
}

.wc-block-checkout .acfw-gc-recipient-form {
    margin: 24px 0;
    padding: 24px;
}

.wc-block-checkout .acfw-gc-recipient-form input:focus,
.wc-block-checkout .acfw-gc-recipient-form textarea:focus {
    border-color: var(--acfw-primary);
    box-shadow: 0 0 0 1px var(--acfw-primary);
}

/* ==========================================================================
   10. PRINT STYLES
   ========================================================================== */

@media print {
    .acfw-ac-apply-btn,
    .acfw-btn,
    .acfw-apply-coupon-btn,
    .acfw-dismiss-notice {
        display: none;
    }
    
    .acfw-available-coupons,
    .acfw-card {
        border: 1px solid #000;
        background: #fff;
    }
}

/* ==========================================================================
   11. STORE CREDIT / GIFT CERTIFICATE PRODUCT FORM
   ========================================================================== */

/* Amount Selection */
.acfw-amount-selection {
    margin-bottom: 20px;
}

.acfw-amount-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.acfw-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acfw-amount-btn {
    padding: 10px 20px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.15s;
}

.acfw-amount-btn:hover {
    background: #e5e5e5;
}

.acfw-amount-btn.selected {
    background: #333;
    color: #fff;
}

/* Custom Amount Input */
.acfw-custom-input {
    margin-top: 12px;
}

.acfw-custom-input input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.acfw-custom-input input:focus {
    border-color: #333;
    outline: none;
}

/* Gift Certificate Fields */
.acfw-gc-fields {
    margin-top: 20px;
}

.acfw-field {
    margin-bottom: 15px;
}

.acfw-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.acfw-field label .required {
    color: #e00;
}

.acfw-field input,
.acfw-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.acfw-field textarea {
    min-height: 100px;
    resize: vertical;
}

.acfw-field input:focus,
.acfw-field textarea:focus {
    border-color: #333;
    outline: none;
}
