/* Deals Widget Styles */
.deals-widget-container {
    padding: 3rem 0 5rem;
    background-color: #111827;
    position: relative;
    min-height: 100vh;
}

.deals-widget-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

@media (min-width: 768px) {
    .deals-widget-container {
        padding: 5rem 0;
    }
}

.deals-widget-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

/* Header Styles */
.deals-header {
    text-align: center;
    margin-bottom: 3rem;
}

.deals-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: #1f2937;
    border: 1px solid #374151;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.zap-icon {
    color: #facc15;
    font-size: 1rem;
}

.deals-badge span:last-child {
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.deals-title {
    font-size: 2.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .deals-title {
        font-size: 3rem;
    }
}

.gradient-text {
    background: linear-gradient(to right, #60a5fa, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.deals-subtitle {
    color: #9ca3af;
    font-size: 1.125rem;
    max-width: 32rem;
    margin: 0 auto;
}

/* Grid Styles */
.deals-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .deals-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}

/* Deal Card Styles */
.deal-card {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    transition: all 0.5s;
    cursor: pointer;
}

.deal-card:hover {
    box-shadow: 0 25px 50px -12px rgba(14, 165, 233, 0.2);
    transform: translateY(-4px);
}

.deal-large {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .deal-large {
        grid-column: span 8; /* 66% - 2/3 width */
    }
}

.deal-medium {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .deal-medium {
        grid-column: span 6; /* 50% - 1/2 width */
    }
}

.deal-small {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .deal-small {
        grid-column: span 4; /* 33% - 1/3 width */
    }
}

/* Deal Background Container - Absolute positioned wrapper */
.deal-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: inherit !important;
    z-index: 1 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Image Styles - ULTIMATE COVERAGE FIX - Maximum Specificity */
/* Base image styles with maximum specificity */
.elementor-widget-deals-widget .deals-widget-container .deal-card .deal-bg .deal-image,
.elementor-widget-deals-widget .deals-widget-container .deal-card .deal-bg img.deal-image,
.elementor-widget-deals-widget .deal-card .deal-bg .deal-image,
.elementor-widget-deals-widget .deal-card .deal-bg img.deal-image,
.deals-widget-container .deal-card .deal-bg .deal-image,
.deals-widget-container .deal-card .deal-bg img.deal-image,
.deal-card .deal-bg .deal-image,
.deal-card .deal-bg img.deal-image,
.deal-bg > .deal-image,
.deal-bg > img.deal-image,
.deal-bg .deal-image,
.deal-bg img.deal-image,
img.deal-image {
    /* Position and sizing - CRITICAL */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    
    /* Reset any conflicting dimensions */
    max-width: none !important;
    max-height: none !important;
    min-width: 100% !important;
    min-height: 100% !important;
    
    /* Object fit and positioning */
    object-fit: cover !important;
    object-position: center center !important;
    
    /* Display and layout */
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    
    /* Visual effects */
    transition: transform 1s ease !important;
    filter: grayscale(30%) !important;
    z-index: 1 !important;
    
    /* Prevent any flex/grid interference */
    flex: none !important;
    align-self: stretch !important;
    justify-self: stretch !important;
}

/* Elementor Editor & Frontend Override - ENHANCED */
.elementor-widget-deals-widget .deal-bg .deal-image,
.elementor-widget-deals-widget .deal-bg img.deal-image,
.elementor-widget-deals-widget img.deal-image,
.elementor-editor-active .deal-bg .deal-image,
.elementor-editor-active .deal-bg img.deal-image,
.elementor-editor-active img.deal-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100% !important;
    min-height: 100% !important;
    z-index: 1 !important;
}

/* Inline style override - COMPREHENSIVE COVERAGE */
.deal-bg img[style],
.deal-bg .deal-image[style],
.elementor-widget-deals-widget .deal-bg img[style],
.elementor-widget-deals-widget .deal-bg .deal-image[style] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100% !important;
    min-height: 100% !important;
    z-index: 1 !important;
}

/* Additional Coverage Rules for Edge Cases */
/* WordPress/Elementor theme overrides - ENHANCED */
.elementor-section .deal-bg img,
.elementor-container .deal-bg img,
.elementor-row .deal-bg img,
.elementor-column .deal-bg img,
.elementor-widget .deal-bg img,
.elementor-section .deal-bg .deal-image,
.elementor-container .deal-bg .deal-image,
.elementor-row .deal-bg .deal-image,
.elementor-column .deal-bg .deal-image,
.elementor-widget .deal-bg .deal-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100% !important;
    min-height: 100% !important;
    z-index: 1 !important;
}

/* Responsive image fixes */
.deal-bg img.wp-post-image,
.deal-bg img.attachment-full,
.deal-bg img.size-full {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* Lazy loading compatibility */
.deal-bg img[loading],
.deal-bg img[data-src],
.deal-bg img.lazyload,
.deal-bg img.lazyloaded {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* Hover Effect */
.deal-card:hover .deal-bg .deal-image,
.deal-card:hover .deal-image {
    transform: scale(1.1) !important;
    filter: grayscale(0%) !important;
}

.deal-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to top, #030712, rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.2));
}

.deal-hover-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
    mix-blend-mode: overlay;
}

.deal-card:hover .deal-hover-overlay {
    opacity: 0.3;
}

.deal-hover-overlay.deal-orange {
    background: linear-gradient(to bottom right, #f97316, #dc2626);
}

.deal-hover-overlay.deal-blue {
    background: linear-gradient(to bottom right, #3b82f6, #06b6d4);
}

.deal-hover-overlay.deal-purple {
    background: linear-gradient(to bottom right, #8b5cf6, #6366f1);
}

.deal-hover-overlay.deal-green {
    background: linear-gradient(to bottom right, #10b981, #22c55e);
}

.deal-hover-overlay.deal-yellow {
    background: linear-gradient(to bottom right, #eab308, #f97316);
}

.deal-content {
    position: relative;
    z-index: 10;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (min-width: 768px) {
    .deal-content {
        padding: 2rem;
    }
}

.deal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: auto;
}

.deal-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .deal-badge {
        font-size: 0.75rem;
    }
}

.deal-badge.deal-orange {
    background: linear-gradient(to right, #f97316, #dc2626);
}

.deal-badge.deal-blue {
    background: linear-gradient(to right, #3b82f6, #06b6d4);
}

.deal-badge.deal-purple {
    background: linear-gradient(to right, #8b5cf6, #6366f1);
}

.deal-badge.deal-green {
    background: linear-gradient(to right, #10b981, #22c55e);
}

.deal-badge.deal-yellow {
    background: linear-gradient(to right, #eab308, #f97316);
}

.deal-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.star {
    color: #facc15;
    font-size: 0.875rem;
}

.rating-value {
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.rating-count {
    color: #9ca3af;
    font-size: 0.625rem;
}

.deal-body {
    margin-top: auto;
}

.deal-title {
    font-weight: bold;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 1.5rem;
}

.deal-title-large {
    font-size: 1.875rem;
}

@media (min-width: 768px) {
    .deal-title-large {
        font-size: 3rem;
    }
}

.deal-subtitle {
    color: #d1d5db;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.deal-subtitle-large {
    font-size: 1.125rem;
}

.deal-features {
    list-style: none;
    margin-bottom: 1.5rem;
    padding: 0;
}

.deal-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #e5e7eb;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.check-icon {
    padding: 0.125rem;
    border-radius: 50%;
    color: white;
    font-size: 0.625rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-icon.deal-orange {
    background: linear-gradient(to right, #f97316, #dc2626);
}

.check-icon.deal-blue {
    background: linear-gradient(to right, #3b82f6, #06b6d4);
}

.check-icon.deal-purple {
    background: linear-gradient(to right, #8b5cf6, #6366f1);
}

.check-icon.deal-green {
    background: linear-gradient(to right, #10b981, #22c55e);
}

.check-icon.deal-yellow {
    background: linear-gradient(to right, #eab308, #f97316);
}

.deal-feature span:last-child {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.deal-divider {
    height: 1px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.deal-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

@media (min-width: 1280px) {
    .deal-footer {
        flex-direction: row;
        align-items: flex-end;
    }
}

.deal-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.deal-price {
    font-weight: bold;
    color: white;
    letter-spacing: -0.025em;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    font-size: 1.875rem;
}

.deal-price-large {
    font-size: 2.25rem;
}

@media (min-width: 768px) {
    .deal-price-large {
        font-size: 3rem;
    }
}

.deal-period {
    color: #d1d5db;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    outline: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-gradient {
    color: white;
    border: none;
    transition: filter 0.2s;
}

.btn-gradient:hover {
    filter: brightness(1.1);
}

.btn-gradient.deal-orange {
    background: linear-gradient(to right, #f97316, #dc2626);
}

.btn-gradient.deal-blue {
    background: linear-gradient(to right, #3b82f6, #06b6d4);
}

.btn-gradient.deal-purple {
    background: linear-gradient(to right, #8b5cf6, #6366f1);
}

.btn-gradient.deal-green {
    background: linear-gradient(to right, #10b981, #22c55e);
}

.btn-gradient.deal-yellow {
    background: linear-gradient(to right, #eab308, #f97316);
}

.arrow {
    margin-left: 0.5rem;
}

/* Countdown Styles */
.countdown {
    margin-top: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: white;
    font-family: 'Courier New', monospace;
    flex-wrap: wrap;
}

.countdown-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    line-height: 1;
}

.clock-icon {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1;
}

.countdown-label span:last-child {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

.countdown-timer {
    display: flex;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: bold;
    letter-spacing: -0.025em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    align-items: flex-start;
    flex-wrap: wrap;
    line-height: 1;
}

@media (min-width: 768px) {
    .countdown-timer {
        font-size: 1.25rem;
        gap: 0.75rem;
    }
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    min-width: 2rem;
}

.time-value {
    display: block;
    font-size: inherit;
}

.time-label {
    font-size: 0.625rem;
    font-family: inherit;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    margin-top: 0.125rem;
}

.time-separator {
    opacity: 0.7;
    align-self: flex-start;
    margin-top: 0.125rem;
    font-size: 1em;
}

/* Full Width Countdown */
.countdown-full-width {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

.countdown-full-width .countdown-label {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.countdown-full-width .countdown-timer {
    width: 100%;
    justify-content: center;
}

.deal-note {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-top: 0.75rem;
    opacity: 0.6;
}

/* Expired Message */
.expired-message {
    background-color: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #fca5a5;
    font-weight: 600;
    text-align: center;
    font-size: 0.875rem;
}

/* Debug and Fallback Styles */
/* Fallback for missing images */
.deal-bg:empty::before,
.deal-bg:not(:has(img))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    z-index: 0;
}

/* Ensure container has proper dimensions */
.deal-card {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Force proper stacking context */
.deal-bg {
    contain: layout style paint !important;
}

/* Additional browser-specific fixes */
@supports (object-fit: cover) {
    .deal-bg img {
        object-fit: cover !important;
    }
}

@supports not (object-fit: cover) {
    .deal-bg img {
        width: 100% !important;
        height: 100% !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

/* ULTIMATE HEIGHT FIX - NUCLEAR OPTION */
/* This will override ANY theme or plugin CSS */
.deal-bg img,
.deal-bg .deal-image,
.deal-bg > img,
.deal-bg > .deal-image,
div.deal-bg img,
div.deal-bg .deal-image,
.deals-widget-container .deal-bg img,
.deals-widget-container .deal-bg .deal-image,
.elementor-widget .deal-bg img,
.elementor-widget .deal-bg .deal-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

/* Force height with CSS custom property fallback */
.deal-bg {
    --deal-height: 100%;
}

.deal-bg img,
.deal-bg .deal-image {
    height: var(--deal-height) !important;
    min-height: var(--deal-height) !important;
}

/* High DPI display fixes */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .deal-bg img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    .deals-widget-inner {
        padding: 0 0.75rem;
    }
    
    .deal-content {
        padding: 1rem 1.5rem;
    }
    
    /* Improve countdown spacing on mobile */
    .countdown {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .countdown-timer {
        font-size: 1rem !important;
        gap: 0.375rem;
    }
    
    .countdown-label {
        align-self: flex-start;
    }
    
    .time-unit {
        min-width: 1.75rem;
    }
    
    .time-label {
        font-size: 0.5rem;
    }
}
