/**
 * Coupon Designs CSS - Premium Edition v1.3
 *
 * Modern, luxury coupon design system with 2025 design trends:
 * - Glassmorphism effects
 * - Soft shadows & depth
 * - Refined typography
 * - Smooth micro-interactions
 * - Adaptive amount sizing
 * - Compact mode for narrow containers
 *
 * @package AdvancedCoupons
 * @since 1.2.0
 * @updated 1.3.0 - Added adaptive sizing, compact mode, container queries
 */

/* ==========================================================================
   Design System Variables
   ========================================================================== */
:root {
    /* Transitions */
    --acfw-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --acfw-duration: 200ms;
    
    /* Shadows - Layered for depth */
    --acfw-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --acfw-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --acfw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --acfw-shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    --acfw-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);
    
    /* Border Radius */
    --acfw-radius-sm: 6px;
    --acfw-radius-md: 10px;
    --acfw-radius-lg: 14px;
    --acfw-radius-xl: 20px;
    
    /* Typography */
    --acfw-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --acfw-font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* ==========================================================================
   Adaptive Amount Sizing - Handles $ and % amounts
   ========================================================================== */

/* Short amounts: 20%, $10, 5% */
.acfw-coupon-amount[data-length="short"] {
    font-size: 42px;
}

/* Medium amounts: $99.99, 100%, $500 */
.acfw-coupon-amount[data-length="medium"] {
    font-size: 32px;
}

/* Long amounts: $1,234.56, $12,345.67 */
.acfw-coupon-amount[data-length="long"] {
    font-size: 24px;
}

/* Ensure amount doesn't overflow */
.acfw-coupon-amount {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Compact Mode - For narrow containers (sidebar, mobile)
   ========================================================================== */

/* Compact mode class */
.acfw-coupon.acfw-compact,
.acfw-narrow-container .acfw-coupon {
    width: 100%;
    min-width: auto;
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.acfw-coupon.acfw-compact .acfw-coupon-amount,
.acfw-narrow-container .acfw-coupon .acfw-coupon-amount {
    font-size: 18px !important;
    white-space: nowrap;
}

.acfw-coupon.acfw-compact .acfw-coupon-code,
.acfw-narrow-container .acfw-coupon .acfw-coupon-code {
    font-size: 11px;
}

.acfw-coupon.acfw-compact .acfw-coupon-expiry,
.acfw-narrow-container .acfw-coupon .acfw-coupon-expiry {
    font-size: 10px;
}

/* Container query for auto-compact (modern browsers) */
@supports (container-type: inline-size) {
    .acfw-ac-list {
        container-type: inline-size;
    }
    
    @container (max-width: 350px) {
        .acfw-coupon {
            width: 100%;
            min-width: auto;
            min-height: 60px;
        }
        
        .acfw-coupon .acfw-coupon-amount {
            font-size: 18px !important;
        }
    }
}


/* ==========================================================================
   Admin: Color Schemes Grid
   ========================================================================== */
.acfw-color-schemes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    max-width: 800px;
}

.acfw-color-scheme-item {
    cursor: pointer;
    position: relative;
}

.acfw-color-scheme-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.acfw-color-swatch {
    display: flex;
    width: 48px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all var(--acfw-duration) var(--acfw-ease);
    box-shadow: var(--acfw-shadow-sm), inset 0 0 0 1px rgba(255,255,255,0.1);
}

.acfw-color-swatch span {
    flex: 1;
}

.acfw-color-scheme-item:hover .acfw-color-swatch {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--acfw-shadow-md);
}

.acfw-color-scheme-item.selected .acfw-color-swatch,
.acfw-color-scheme-item input:checked + .acfw-color-swatch {
    border-color: #3b82f6;
    box-shadow: var(--acfw-shadow-md), 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Admin: Custom Colors
   ========================================================================== */
.acfw-custom-colors {
    margin: 16px 0;
}

.acfw-color-picker-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.acfw-color-preview {
    display: inline-block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    border: 2px solid #e2e8f0;
    box-shadow: var(--acfw-shadow-sm);
    overflow: hidden;
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-color-preview:hover {
    transform: scale(1.08);
    box-shadow: var(--acfw-shadow-md);
}

.acfw-color-preview input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
}

.acfw-randomize-colors {
    padding: 10px 14px;
    border-radius: 8px;
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-randomize-colors:hover {
    background: #f1f5f9;
}


/* ==========================================================================
   Admin: Coupon Styles Grid
   ========================================================================== */
.acfw-coupon-styles,
.acfw-email-styles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    margin: 24px 0;
    max-width: 1200px;
}

.acfw-style-item {
    cursor: pointer;
    text-align: center;
    position: relative;
}

.acfw-style-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.acfw-style-preview-wrapper {
    position: relative;
    transition: all var(--acfw-duration) var(--acfw-ease);
    border-radius: var(--acfw-radius-lg);
}

.acfw-style-item:hover .acfw-style-preview-wrapper {
    transform: translateY(-6px);
}

.acfw-style-item.active .acfw-style-preview-wrapper,
.acfw-style-item input:checked ~ .acfw-style-preview-wrapper {
    outline: 3px solid #3b82f6;
    outline-offset: 6px;
    border-radius: var(--acfw-radius-lg);
}

.acfw-style-name {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Coupon Base - Premium Foundation
   ========================================================================== */
.acfw-coupon {
    position: relative;
    font-family: var(--acfw-font-display);
    cursor: pointer;
    transition: all var(--acfw-duration) var(--acfw-ease);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.acfw-coupon * {
    box-sizing: border-box;
}

.acfw-coupon:hover {
    transform: translateY(-4px);
}

/* Coupon code styling - consistent across all designs */
.acfw-coupon-code {
    font-family: var(--acfw-font-mono);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


/* ==========================================================================
   Style: Ticket - Classic 2-Column Gift Coupon with Vertical Dashed Separator
   Elegant design with discount sidebar and content area
   ========================================================================== */
.acfw-design-ticket {
    width: 320px;
    min-height: 130px;
    display: flex;
    border-radius: var(--acfw-radius-md);
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.acfw-design-ticket:hover {
    box-shadow: var(--acfw-shadow-lg);
}

/* Left sidebar - vertical text in row */
.acfw-ticket-sidebar {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    border-right: 2px dashed;
    gap: 6px;
}

.acfw-discount-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    opacity: 0.6;
}

.acfw-discount-amount {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.acfw-discount-amount[data-length="medium"] {
    font-size: 20px;
}

.acfw-discount-amount[data-length="long"] {
    font-size: 15px;
}

/* Right content area */
.acfw-ticket-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px;
}

.acfw-ticket-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.acfw-ticket-desc {
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 10px;
}

.acfw-ticket-code {
    display: inline-block;
    font-family: var(--acfw-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 4px;
    align-self: flex-start;
}

.acfw-ticket-expiry {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 8px;
}

/* Compact mode */
.acfw-design-ticket.acfw-compact {
    width: 100%;
    min-height: 100px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-sidebar {
    width: 60px;
    padding: 12px 6px;
}

.acfw-design-ticket.acfw-compact .acfw-discount-amount {
    font-size: 18px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-content {
    padding: 12px 14px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-title {
    font-size: 12px;
}


/* ==========================================================================
   Style: Flat - Modern Card with Glass Effect
   ========================================================================== */
.acfw-design-flat {
    width: 260px;
    min-height: 110px;
    border-radius: var(--acfw-radius-lg);
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.acfw-design-flat:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-flat .acfw-coupon-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 12px;
}

.acfw-design-flat .acfw-coupon-value {
    flex-shrink: 0;
}

.acfw-design-flat .acfw-coupon-amount {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.acfw-design-flat .acfw-coupon-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.acfw-design-flat .acfw-coupon-desc {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.acfw-design-flat .acfw-coupon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 14px;
    font-size: 12px;
    opacity: 0.9;
}

.acfw-design-flat .acfw-coupon-footer svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    opacity: 0.7;
}

.acfw-design-flat .acfw-coupon-code,
.acfw-design-flat .acfw-coupon-expiry {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
}


/* ==========================================================================
   Style: Cutout - Dashed Border with Scissors (Cut-along-the-line)
   Classic coupon style with dashed border indicating where to cut
   ========================================================================== */
.acfw-design-cutout {
    width: 280px;
    position: relative;
    border: 2px dashed;
    border-radius: var(--acfw-radius-md);
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-design-cutout:hover {
    border-style: solid;
    box-shadow: var(--acfw-shadow-md);
}

/* Scissors icon - positioned on the border line with background to cover dashed border */
.acfw-scissors {
    position: absolute;
    top: -12px;
    left: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: inherit;
    border-radius: 50%;
}

.acfw-scissors svg {
    width: 16px;
    height: 16px;
    transform: rotate(-45deg);
}

/* Dashed line extending from scissors - removed, border already provides this */

/* Inner content */
.acfw-cutout-inner {
    padding: 20px;
}

.acfw-design-cutout .acfw-coupon-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.acfw-design-cutout .acfw-coupon-value {
    text-align: center;
    min-width: 70px;
}

.acfw-design-cutout .acfw-coupon-amount {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.acfw-design-cutout .acfw-coupon-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0.7;
}

.acfw-design-cutout .acfw-coupon-desc {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    padding-top: 4px;
}

.acfw-design-cutout .acfw-coupon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.acfw-design-cutout .acfw-coupon-code {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.acfw-design-cutout .acfw-coupon-expiry {
    font-size: 11px;
    opacity: 0.6;
}

/* Compact mode */
.acfw-design-cutout.acfw-compact {
    width: 100%;
}

.acfw-design-cutout.acfw-compact .acfw-cutout-inner {
    padding: 14px;
}

.acfw-design-cutout.acfw-compact .acfw-coupon-amount {
    font-size: 24px;
}

/* Adaptive amount sizing */
.acfw-design-cutout .acfw-coupon-amount[data-length="medium"] {
    font-size: 26px;
}

.acfw-design-cutout .acfw-coupon-amount[data-length="long"] {
    font-size: 20px;
}


/* Legacy styles (deal, special) removed - mapped to 'flat' in PHP */
    padding: 0;
}


/* ==========================================================================
   Style: Festive - Event/Promotion with "GIFT FOR YOU" sidebar
   Using position absolute for sidebar - guaranteed full height in any context
   ========================================================================== */
.acfw-coupon.acfw-design-festive {
    width: 340px;
    min-height: 160px;
    position: relative;
    border-radius: var(--acfw-radius-md);
    box-shadow: var(--acfw-shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.acfw-coupon.acfw-design-festive:hover {
    box-shadow: var(--acfw-shadow-lg);
}

/* Main content area - leave space for sidebar */
.acfw-coupon.acfw-design-festive .acfw-festive-main {
    padding: 20px 24px;
    margin-right: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    box-sizing: border-box;
}

.acfw-coupon.acfw-design-festive .acfw-festive-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.acfw-coupon.acfw-design-festive .acfw-festive-amount {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.acfw-coupon.acfw-design-festive .acfw-amount-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.acfw-coupon.acfw-design-festive .acfw-amount-value[data-length="medium"] {
    font-size: 28px;
}

.acfw-coupon.acfw-design-festive .acfw-amount-value[data-length="long"] {
    font-size: 22px;
}

.acfw-coupon.acfw-design-festive .acfw-star {
    font-size: 16px;
    opacity: 0.7;
}

.acfw-coupon.acfw-design-festive .acfw-festive-type {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.acfw-coupon.acfw-design-festive .acfw-festive-desc {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 12px;
    opacity: 0.85;
}

.acfw-coupon.acfw-design-festive .acfw-festive-code {
    display: inline-block;
    font-family: var(--acfw-font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 6px;
    margin-bottom: 8px;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acfw-coupon.acfw-design-festive .acfw-festive-expiry {
    font-size: 11px;
    opacity: 0.6;
}

/* Right sidebar - Absolute positioned for guaranteed full height */
.acfw-coupon.acfw-design-festive .acfw-festive-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acfw-coupon.acfw-design-festive .acfw-sidebar-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
}

/* Compact mode */
.acfw-coupon.acfw-design-festive.acfw-compact {
    width: 100%;
    min-height: 140px;
}

.acfw-coupon.acfw-design-festive.acfw-compact .acfw-festive-main {
    padding: 16px 20px;
    margin-right: 50px;
    min-height: 140px;
}

.acfw-coupon.acfw-design-festive.acfw-compact .acfw-amount-value {
    font-size: 28px;
}

.acfw-coupon.acfw-design-festive.acfw-compact .acfw-festive-sidebar {
    width: 50px;
}



/* Legacy styles (clipper, basic, badge) removed - mapped to 'flat' or 'minimal' in PHP */

/* ==========================================================================
   Style: Minimal - Ultra Clean Modern
   ========================================================================== */
.acfw-design-minimal {
    width: 260px;
    min-height: 100px;
    padding: 18px 22px;
    border: 2px solid;
    border-radius: var(--acfw-radius-lg);
    box-shadow: var(--acfw-shadow-sm);
}

.acfw-design-minimal:hover {
    box-shadow: var(--acfw-shadow-md);
}

.acfw-design-minimal .acfw-coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.acfw-design-minimal .acfw-coupon-amount {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.acfw-design-minimal .acfw-coupon-code {
    font-size: 10px;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
}

.acfw-design-minimal .acfw-coupon-desc {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
}

.acfw-design-minimal .acfw-coupon-expiry {
    font-size: 11px;
    opacity: 0.7;
}


/* ==========================================================================
   Style: Gradient - Premium Animated Gradient
   ========================================================================== */
.acfw-design-gradient {
    width: 260px;
    min-height: 130px;
    padding: 22px 24px;
    border-radius: var(--acfw-radius-xl);
    text-align: center;
    background-size: 200% 200%;
    animation: acfw-gradient-shift 6s ease infinite;
    position: relative;
    overflow: hidden;
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    pointer-events: none;
}

.acfw-design-gradient:hover {
    box-shadow: var(--acfw-shadow-xl);
    animation-play-state: paused;
}

.acfw-design-gradient .acfw-coupon-amount {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    position: relative;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.acfw-design-gradient .acfw-coupon-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
    position: relative;
    opacity: 0.9;
}

.acfw-design-gradient .acfw-coupon-desc {
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    position: relative;
    opacity: 0.9;
}

.acfw-design-gradient .acfw-coupon-code {
    font-size: 11px;
    margin-top: 14px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    display: inline-block;
    position: relative;
    color: inherit;
    border: none;
}

.acfw-design-gradient .acfw-coupon-expiry {
    font-size: 10px;
    margin-top: 8px;
    opacity: 0.75;
    position: relative;
}

@keyframes acfw-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


/* ==========================================================================
   Style: Email - Premium Email-Safe Design
   ========================================================================== */
.acfw-design-email {
    width: 260px;
    padding: 0;
    border-radius: var(--acfw-radius-lg);
    text-align: center;
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
}

.acfw-design-email:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-email .acfw-coupon-header {
    padding: 28px 24px 16px;
}

.acfw-design-email .acfw-coupon-amount {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.acfw-design-email .acfw-coupon-type {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
    margin-top: 6px;
}

.acfw-design-email .acfw-coupon-code-wrapper {
    padding: 0 24px 20px;
}

.acfw-design-email .acfw-coupon-code {
    font-family: var(--acfw-font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-block;
    border: none;
}

.acfw-design-email .acfw-coupon-desc {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
    padding: 0 24px 16px;
}

.acfw-design-email .acfw-coupon-expiry {
    font-size: 12px;
    opacity: 0.7;
    padding: 0 24px 24px;
}

.acfw-design-email .acfw-coupon-expiry::before {
    content: "⏱ ";
}

/* ==========================================================================
   Admin: Live Preview
   ========================================================================== */
.acfw-design-preview-wrapper {
    margin: 20px 0 30px;
    max-width: 340px;
}

.acfw-design-preview {
    padding: 28px;
    border-radius: var(--acfw-radius-lg);
    text-align: center;
    border: 2px solid;
    box-shadow: var(--acfw-shadow-md);
}

.acfw-design-preview .acfw-preview-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.acfw-design-preview .acfw-preview-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.acfw-design-preview .acfw-preview-type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.acfw-design-preview .acfw-preview-desc {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.acfw-design-preview .acfw-preview-code {
    font-family: var(--acfw-font-mono);
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

.acfw-design-preview .acfw-preview-expiry {
    font-size: 12px;
    opacity: 0.65;
    margin-top: 8px;
}

/* ==========================================================================
   Admin: Upgraded Design Page (v1.3)
   ========================================================================== */

/* Page Layout */
.acfw-designs-v2 {
    max-width: 1400px;
}

/* Presets Section */
.acfw-presets-section {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--acfw-radius-lg);
}

.acfw-presets-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.acfw-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.acfw-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    min-width: 100px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: var(--acfw-radius-md);
    cursor: pointer;
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-preset-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: var(--acfw-shadow-md);
}

.acfw-preset-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.acfw-preset-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.acfw-preset-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.acfw-preset-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Two Column Layout */
.acfw-designs-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin: 24px 0;
}

@media (max-width: 1100px) {
    .acfw-designs-layout {
        grid-template-columns: 1fr;
    }
}

/* Controls Column */
.acfw-designs-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.acfw-design-section {
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--acfw-radius-lg);
}

.acfw-design-section h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* Preview Column */
.acfw-designs-preview {
    position: relative;
}

.acfw-preview-sticky {
    position: sticky;
    top: 40px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--acfw-radius-lg);
}

.acfw-preview-sticky h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
}

/* Context Switcher */
.acfw-preview-context {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.acfw-context-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-context-btn:hover {
    background: #e2e8f0;
}

.acfw-context-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* Preview Container */
.acfw-preview-container {
    min-height: 200px;
    padding: 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--acfw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.acfw-preview-container.acfw-context-mobile {
    max-width: 320px;
    margin: 0 auto;
}

.acfw-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.acfw-preview-loading.is-loading {
    opacity: 1;
    visibility: visible;
}

.acfw-preview-content {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Accessibility Info */
.acfw-accessibility-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.acfw-contrast-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 20px;
}

.acfw-contrast-badge.fail {
    background: #fef2f2;
    color: #dc2626;
}

.acfw-contrast-badge.warn {
    background: #fffbeb;
    color: #d97706;
}

.acfw-contrast-icon {
    font-size: 14px;
}

.acfw-contrast-ratio {
    opacity: 0.7;
}

/* Actions */
.acfw-design-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 24px;
}

.acfw-save-status {
    margin-left: 12px;
    font-size: 13px;
}


/* ==========================================================================
   Admin: Custom Design Section
   ========================================================================== */
.acfw-custom-design {
    margin: 20px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--acfw-radius-lg);
    max-width: 800px;
}

.acfw-custom-design-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.acfw-custom-tab {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-custom-tab:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.acfw-custom-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.acfw-custom-tab input[type="radio"] {
    display: none;
}

.acfw-use-custom-design {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 782px) {
    .acfw-coupon-styles,
    .acfw-email-styles {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .acfw-color-schemes {
        gap: 8px;
    }
    
    .acfw-color-swatch {
        width: 40px;
        height: 28px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .acfw-coupon {
        display: inline-block;
        page-break-inside: avoid;
        margin: 10px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Frontend: Coupons List
   ========================================================================== */
.acfw-coupons-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

@media (min-width: 768px) {
    .acfw-coupons-list {
        gap: 28px;
    }
}

/* ==========================================================================
   WooCommerce Price Styling
   ========================================================================== */
.acfw-coupon .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

.acfw-coupon .woocommerce-Price-currencySymbol {
    font-size: 0.5em;
    font-weight: 600;
    vertical-align: super;
    margin-right: 1px;
}

/* Legacy style (voucher) removed - mapped to 'flat' in PHP */
