/**
 * DoctorBookly — /pages/offers listing cards (responsive polish)
 * Loaded after inline offers.php styles.
 */

/* Pricing box — price info only (CTA lives in action bar below) */
.offer-pricing-box {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

/* Hide legacy in-box CTA only inside pricing box */
.offer-pricing-box .offer-pricing-box__cta,
.offer-pricing-box > .claim-btn {
    display: none !important;
}

/* Bottom action bar: Share | Detail | primary CTA (WhatsApp / Instagram / etc.) */
.offers-grid .offer-card-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-top: auto !important;
    padding: 10px !important;
    border-radius: 12px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
}

.offers-grid .offer-card-actions-left {
    display: flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    gap: 8px !important;
}

.offers-grid .offer-card-actions .offer-card-share-btn,
.offers-grid .offer-card-actions .offer-card-details-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
}

.offers-grid .offer-card-actions .claim-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin-left: auto !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.16) !important;
}

.offers-grid .offer-card-actions .claim-btn::before {
    display: none !important;
}

.offers-grid .offer-card-actions .claim-btn i {
    font-size: 14px !important;
    color: #fff !important;
    flex-shrink: 0 !important;
}

.offers-grid .offer-card-actions .claim-btn .claim-btn__label {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

/* Card shell — hospital-style accent */
.offers-grid .offer-card {
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.3s ease, border-color 0.25s ease, transform 0.28s ease;
}

.offers-grid .offer-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #0d9488, #0f766e);
    border-radius: 18px 0 0 18px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
    pointer-events: none;
}

.offers-grid .offer-card.offer-card--inview:hover::before {
    opacity: 1;
}

.offers-grid .offer-card .offer-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 16px 14px;
}

.offers-grid .offer-meta-line {
    font-size: 11px;
    padding: 8px 12px;
    gap: 4px 8px;
    line-height: 1.4;
}

.offers-grid .offer-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.offers-grid .offer-card-engagement {
    padding: 6px;
    gap: 5px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.offers-grid .offer-card-engagement .offer-eng-cell {
    padding: 5px 4px;
    border-radius: 8px;
}

.offers-grid .offer-pricing-box {
    margin-top: 4px;
    margin-bottom: 10px;
}

.offers-grid .sale-price {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.offers-grid .offer-meta {
    font-size: 11px;
}

.offers-grid .offer-meta .countdown,
.offers-grid .offer-meta [class*='countdown'] {
    font-variant-numeric: tabular-nums;
}

.offers-grid .special-tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Tablet — 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .offers-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 18px !important;
        padding: 0 18px !important;
    }

    .offers-grid .offer-image {
        min-height: 170px !important;
        max-height: 190px !important;
        aspect-ratio: 16 / 10 !important;
    }
}

/* Desktop / laptop — 3 columns */
@media (min-width: 1024px) {
    .offers-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 22px !important;
        max-width: 1280px !important;
        align-items: stretch !important;
    }

    .offers-grid .offer-card {
        min-height: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .offers-grid .offer-image {
        min-height: 165px !important;
        max-height: 185px !important;
        height: auto !important;
        aspect-ratio: 16 / 10 !important;
    }

    .offers-grid .offer-content {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        padding: 14px 14px 12px !important;
    }

    .offers-grid .offer-title {
        font-size: 1rem !important;
        line-height: 1.28 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .offers-grid .offer-description-snippet {
        font-size: 12px !important;
        line-height: 1.4 !important;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 6px !important;
    }

    .offers-grid .offer-card-actions .claim-btn {
        min-height: 42px !important;
        font-size: 12px !important;
    }
}

/* Mobile — compact */
@media (max-width: 767px) {
    .offers-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 0 12px !important;
        margin: 16px auto !important;
    }

    .offers-grid .offer-card {
        min-height: 0 !important;
        border-radius: 14px !important;
    }

    .offers-grid .offer-image {
        height: 132px !important;
        min-height: 132px !important;
        max-height: 132px !important;
        aspect-ratio: unset !important;
    }

    .offers-grid .offer-content {
        padding: 10px 10px 8px !important;
    }

    .offers-grid .offer-meta-line {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        font-size: 10px !important;
        padding: 6px 8px !important;
    }

    .offers-grid .offer-title {
        font-size: 0.95rem !important;
    }

    .offers-grid .offer-card-actions {
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    .offers-grid .offer-card-actions .offer-card-share-btn,
    .offers-grid .offer-card-actions .offer-card-details-btn {
        min-height: 40px !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    .offers-grid .offer-card-actions .claim-btn {
        min-height: 40px !important;
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
}

@media (max-width: 420px) {
    .offers-grid .offer-image {
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
    }

    .offers-grid .offer-card-engagement .offer-eng-label {
        display: none;
    }

    .offers-grid .offer-coupon-box .coupon-meta-line,
    .offers-grid .offer-coupon-box .payment-chips {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offers-grid .offer-card::before {
        transition: none;
    }
}
