/* Offers Grid Styling with Slider */
.offers-grid-wrapper {
    position: relative;
    overflow: hidden;
    margin: 30px 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: pan-y; /* Allow vertical scrolling but handle horizontal */
}

.offers-grid-wrapper:active {
    cursor: grabbing;
}

.offers-grid {
    display: flex;
    gap: 25px;
    transition: transform 0.5s ease;
}

/* Desktop - 5 columns */
@media (min-width: 1400px) {
    .offer-card {
        flex: 0 0 calc(20% - 20px);
        min-width: calc(20% - 20px);
    }
}

/* Laptop - 4 columns */
@media (min-width: 1025px) and (max-width: 1399px) {
    .offer-card {
        flex: 0 0 calc(25% - 18.75px);
        min-width: calc(25% - 18.75px);
    }
}

/* Tablet - 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .offer-card {
        flex: 0 0 calc(33.333% - 16.67px);
        min-width: calc(33.333% - 16.67px);
    }
    
    .offers-grid {
        gap: 20px;
    }
}

/* Mobile - 1.5 columns (show 1 full + half of next) */
@media (max-width: 768px) {
    .offer-card {
        flex: 0 0 calc(66.666%);
        min-width: calc(66.666%);
    }
    
    .offers-grid {
        gap: 15px;
    }
}

/* Small Mobile - 1.5 columns */
@media (max-width: 480px) {
    .offer-card {
        flex: 0 0 calc(70%);
        min-width: calc(70%);
    }
    
    .offers-grid {
        gap: 12px;
    }
}

/* Offer Card */
.offer-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.offer-thumbnail {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.offer-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.offer-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.offer-card:hover .offer-thumbnail img {
    transform: scale(1.1);
}

.offer-content {
    padding: 20px;
    text-align: center;
}

.offer-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offer-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.offer-title a:hover {
    color: #e74c3c;
}

/* Countdown Timer - Fixed Layout */
.offer-countdown,
.single-offer-countdown {
    margin: 15px 0;
}

.single-offer-countdown h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 100%;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 10px 5px;
    border-radius: 6px;
    min-height: 60px;
}

.countdown-value {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    line-height: 1;
}

.countdown-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    margin-top: 4px;
    white-space: nowrap;
}

.countdown-expired {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

/* View Offer Button - Centered */
.offer-view-btn {
    display: block;
    margin: 15px auto 0;
    padding: 12px 30px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
    font-weight: 500;
    text-align: center;
    max-width: 180px;
    width: 100%;
}

.offer-view-btn:hover {
    background: #c0392b;
    color: #fff;
}

/* Single Offer Page */
.single-offer-details {
    max-width: 800px;
    margin: 0 auto;
}

.single-offer-thumbnail {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.single-offer-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.single-offer-countdown {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.single-offer-countdown .countdown-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 100%;
}

.single-offer-countdown .countdown-item {
    padding: 15px 20px;
    min-width: 80px;
    min-height: auto;
}

.single-offer-countdown .countdown-value {
    font-size: 32px;
}

.single-offer-countdown .countdown-label {
    font-size: 12px;
}

.single-offer-description {
    line-height: 1.8;
}

.single-offer-description h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.single-offer-description p {
    margin-bottom: 15px;
    color: #555;
}

/* No Offers Message */
.no-offers {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 18px;
}

/* Inactive Offer Notice */
.offer-inactive-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

/* Responsive Adjustments */
@media (min-width: 1025px) and (max-width: 1399px) {
    .offer-thumbnail {
        height: 280px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .offer-thumbnail {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .offer-thumbnail {
        height: 220px;
    }
    
    .offer-title {
        font-size: 16px;
        min-height: 40px;
    }
    
    .countdown-timer {
        gap: 5px;
    }
    
    .countdown-item {
        padding: 8px 4px;
        min-height: 50px;
    }
    
    .countdown-value {
        font-size: 20px;
    }
    
    .countdown-label {
        font-size: 9px;
    }
    
    .offer-view-btn {
        padding: 10px 20px;
        font-size: 14px;
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .offer-content {
        padding: 15px;
    }
    
    .offer-thumbnail {
        height: 200px;
    }
    
    .offer-title {
        font-size: 15px;
        min-height: 38px;
        margin-bottom: 10px;
    }
    
    .countdown-item {
        padding: 7px 4px;
        min-height: 48px;
    }
    
    .countdown-value {
        font-size: 18px;
    }
    
    .countdown-label {
        font-size: 8px;
    }
    
    .offer-view-btn {
        padding: 10px 20px;
        font-size: 13px;
        margin-top: 10px;
    }
}