/**
 * Modern Offers Section Styles
 * Premium redesigned offers section with modern UI/UX
 */

/* Section Container */
.offers-section-modern {
    position: relative;
    overflow: hidden;
}

/* Slider Container */
.offers-slider-modern {
    position: relative;
    padding: 0 80px;
}

@media (max-width: 768px) {
    .offers-slider-modern {
        padding: 0 16px;
    }
}

/* Navigation Buttons */
.offers-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    will-change: transform;
    contain: layout style paint;
}

.dark .offers-nav-btn {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

.offers-nav-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3), 0 4px 6px -2px rgba(220, 38, 38, 0.2);
}

.offers-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.offers-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.offers-nav-btn:disabled:hover {
    background: white;
    border-color: #e5e7eb;
    color: inherit;
    transform: translateY(-50%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .offers-nav-btn:disabled:hover {
    background: #374151;
    border-color: #4b5563;
}

.offers-nav-btn i {
    font-size: 14px;
    color: inherit;
}

/* Custom positioning for navigation buttons */
#offers-next-modern {
    left: -7px !important;
    top: 230px !important;
    transform: none !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

#offers-prev-modern {
    right: -7px !important;
    left: auto !important;
    top: 232px !important;
    transform: none !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

/* Cards Container */
.offers-cards-container {
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 38, 38, 0.3) transparent;
}

.offers-cards-container::-webkit-scrollbar {
    height: 8px;
}

.offers-cards-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.dark .offers-cards-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.offers-cards-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 10px;
}

.offers-cards-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #b91c1c 0%, #991b1b 100%);
}

@media (max-width: 768px) {
    .offers-cards-container {
        gap: 0;
        padding: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
}

    .offers-cards-container::-webkit-scrollbar {
        display: none;
        height: 0;
    }
}

/* Offer Card */
.offer-card-modern {
    position: relative;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    height: 520px;
    min-height: 520px;
    border: 2px solid transparent;
    flex-shrink: 0;
    width: 320px;
    min-width: 320px;
    will-change: transform;
    contain: layout style paint;
}

.dark .offer-card-modern {
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.offer-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(220, 38, 38, 0.2), 0 10px 10px -5px rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
}

.dark .offer-card-modern:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Card Link Overlay */
.offer-card-link-modern {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 30; /* Higher than overlay to ensure clicks work */
    text-decoration: none;
}

/* Discount Badge */
.offer-discount-modern {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 14;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

[dir="rtl"] .offer-discount-modern {
    left: auto;
    right: 16px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6);
    }
}

.offer-discount-modern .discount-percent {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.offer-discount-modern .discount-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Status Overlays */
.offer-status-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
}

.offer-upcoming-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.offer-expired-overlay {
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none; /* Allow clicks to pass through to the link */
}

.status-content {
    text-align: center;
    color: white;
}

.status-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: lock-bounce 2s ease-in-out infinite;
}

.offer-upcoming-overlay .status-icon {
    color: #fbbf24;
}

.offer-expired-overlay .status-icon {
    color: #9ca3af;
}

@keyframes lock-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

.status-text {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Image Section */
.offer-image-section {
    position: relative;
    width: 100%;
    height: 200px;
    background: white;
    overflow: hidden;
}

/* Like Button Over Image */
.offer-like-btn-over-image {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 15;
    backdrop-filter: blur(4px);
}

[dir="rtl"] .offer-like-btn-over-image {
    right: auto;
    left: 12px;
}

.dark .offer-like-btn-over-image {
    background: rgba(31, 41, 55, 0.95);
    border-color: #ef4444;
}

.offer-like-btn-over-image:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.offer-like-btn-over-image:active {
    transform: scale(0.95);
}

.offer-like-btn-over-image.liked {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.offer-like-btn-over-image.liked i {
    font-weight: 900;
}

.offer-like-btn-over-image i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.offer-like-btn-over-image:hover i {
    transform: scale(1.1);
}

.dark .offer-image-section {
    background: white;
}

.offer-carousel-modern {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: white;
}

@media (max-width: 768px) {
    .carousel-slide {
        padding: 8px;
    }
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    will-change: transform;
    contain: layout style paint;
    background: white;
}

@media (max-width: 768px) {
    .carousel-slide img {
        width: 110%;
        height: 110%;
        max-width: 110%;
        max-height: 110%;
    }
}

.offer-card-modern:hover .carousel-slide.active img {
    transform: scale(1.05);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicator.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Carousel Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.offer-carousel-modern:hover .carousel-control {
    opacity: 1;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

[dir="rtl"] .carousel-prev {
    left: auto;
    right: 12px;
}

[dir="rtl"] .carousel-next {
    right: auto;
    left: 12px;
}

.carousel-control i {
    font-size: 12px;
}

/* Placeholder */
.offer-placeholder-modern {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #9ca3af;
    font-size: 64px;
}

.dark .offer-placeholder-modern {
    background: white;
    color: #4b5563;
}

/* Content Section */
.offer-content-section {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
    text-align: left;
    align-items: flex-start;
    justify-content: space-between;
}

/* Title */
.offer-title-modern {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
    text-align: left;
    width: 100%;
}

.dark .offer-title-modern {
    color: white;
}

/* Description */
.offer-description-modern {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    text-align: right;
    width: 100%;
}

.dark .offer-description-modern {
    color: #9ca3af;
}

/* Countdown Timer */
.offer-countdown-modern {
    margin: 8px 0 12px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    width: auto;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.countdown-number {
    font-size: 16px;
    font-weight: 800;
    color: white;
    line-height: 1;
    min-width: 22px;
    text-align: center;
}

.countdown-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1;
}

.countdown-separator {
    font-size: 16px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 1px;
    line-height: 1;
}

.countdown-progress {
    width: 100%;
    height: 3px;
    background: rgba(220, 38, 38, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.countdown-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
    border-radius: 2px;
    transition: width 1s ease-out;
    width: 0%;
}

/* Price Section */
.offer-price-section {
    margin: 0 0 12px 0;
    width: 100%;
    text-align: left;
    display: inline-block;
}

.price-wrapper {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.price-original {
    font-size: 16px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 600;
}

.dark .price-original {
    color: #6b7280;
}

.price-discounted {
    font-size: 24px;
    color: #dc2626;
    font-weight: 800;
    line-height: 1;
}

.dark .price-discounted {
    color: #ef4444;
}

/* Action Buttons */
.offer-actions-modern {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 0;
    width: 100%;
    justify-content: flex-start;
}

.offer-btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    position: relative;
    z-index: 10;
}

.offer-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
}

.offer-btn-primary:active {
    transform: translateY(0);
}

.offer-btn-primary i {
    font-size: 18px;
}

.offer-btn-secondary {
    width: 40px;
    height: 40px;
    background: white;
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.dark .offer-btn-secondary {
    background: #1f2937;
    border-color: #ef4444;
}

.offer-btn-secondary:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.offer-btn-secondary:active {
    transform: translateY(0);
}

.offer-btn-secondary.liked {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.offer-btn-secondary.liked i {
    font-weight: 900;
}

.offer-btn-secondary i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.offer-btn-secondary:hover i {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .offers-slider-modern {
        padding: 0 60px;
    }
    
    .offers-nav-btn {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 768px) {
    .offers-slider-modern {
        padding: 0 16px;
    }

    .offers-nav-btn {
        display: flex !important;
        width: 44px;
        height: 44px;
        background: white;
        border: 2px solid #e5e7eb;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 30 !important;
        pointer-events: auto !important;
    }
    
    #offers-next-modern {
        left: -7px !important;
        top: 230px !important;
        transform: none !important;
    }
    
    #offers-prev-modern {
        right: -7px !important;
        left: auto !important;
        top: 232px !important;
        transform: none !important;
    }

    .dark .offers-nav-btn {
        background: #374151;
        border-color: #4b5563;
    }

    .offers-nav-btn:hover {
        background: #dc2626;
        border-color: #dc2626;
        transform: translateY(0) scale(1.05);
    }

    .offers-nav-btn:active {
        transform: translateY(0) scale(0.95);
    }

    .offers-nav-btn i {
        font-size: 12px;
    }

    .offers-cards-container {
        gap: 0;
        padding: 16px 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .offers-cards-container::-webkit-scrollbar {
        display: none;
    }
    
    .offer-card-modern {
        width: 85vw;
        min-width: 85vw;
        max-width: 85vw;
        height: 500px;
        min-height: 500px;
        border-radius: 20px;
        margin-right: 16px;
        scroll-snap-align: start;
    }
    
    .offer-card-modern:first-child {
        margin-left: 0;
}

    .offer-card-modern:last-child {
        margin-right: 16px;
        padding-right: 16px;
    }
    
    [dir="rtl"] .offer-card-modern {
        margin-right: 0;
        margin-left: 16px;
    }
    
    [dir="rtl"] .offer-card-modern:first-child {
        margin-right: 0;
}

    [dir="rtl"] .offer-card-modern:last-child {
        margin-left: 16px;
        padding-left: 16px;
        padding-right: 0;
}

    .offer-image-section {
        height: 240px;
        min-height: 240px;
}

    .offer-content-section {
        padding: 16px;
        gap: 10px;
        text-align: left;
        align-items: flex-start;
}

    .offer-title-modern {
        font-size: 17px;
        min-height: 2.2em;
}

    .offer-description-modern {
    font-size: 13px;
        min-height: 2.6em;
}

    .price-discounted {
        font-size: 24px;
    }
    
    .countdown-number {
        font-size: 15px;
    }
    
    .countdown-display {
        padding: 8px 10px;
}

    .offer-btn-primary {
        padding: 10px 16px;
        font-size: 13px;
}

    .offer-btn-secondary {
        width: 40px;
        height: 40px;
}
}

@media (max-width: 640px) {
    .offers-slider-modern {
        padding: 0;
    }
    
    .offers-nav-btn {
        display: flex !important;
        width: 44px;
        height: 44px;
        z-index: 30 !important;
        pointer-events: auto !important;
    }
    
    #offers-next-modern {
        left: -7px !important;
        top: 230px !important;
        transform: none !important;
    }
    
    #offers-prev-modern {
        right: -7px !important;
        left: auto !important;
        top: 232px !important;
        transform: none !important;
    }
    
    .offer-card-modern {
        width: 90vw;
        min-width: 90vw;
        height: 500px;
        min-height: 500px;
    }
    
    .offer-image-section {
        height: 220px;
        min-height: 220px;
    }
    
    .offer-content-section {
        padding: 14px;
        gap: 8px;
    }
    
    .offer-content-section {
        padding: 16px;
    }
    
    .offer-actions-modern {
        flex-direction: column;
    }
    
    .offer-btn-secondary {
        width: 100%;
    }
}

/* RTL Support */
[dir="rtl"] .offers-nav-btn {
    transform: translateY(-50%);
}

[dir="rtl"] .offers-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

[dir="rtl"] .offers-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

[dir="rtl"] .offers-nav-btn:disabled:hover {
    transform: translateY(-50%);
}
