/* Fix Coupon Card Layout - Trang chủ */

/* Container chính */
.coupon-item {
    margin-bottom: 20px !important;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.coupon-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Logo/Banner store */
.coupon-item .store-thumb-link {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    padding: 0;
}

/* Ảnh banner/logo - hiển thị full, không cắt */
.coupon-item .store-thumb-link img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    padding: 10px;
}

/* Tiêu đề coupon - fix chiều cao */
.coupon-item .coupon-title {
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-bottom: 10px;
}

.coupon-item .coupon-title a {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.coupon-item .coupon-title a:hover {
    color: #0066cc;
}

/* Nút action - đồng nhất */
.coupon-item .coupon-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    margin-top: 10px;
}

/* Nút XEM NGAY (sale/deal) */
.coupon-item .coupon-deal {
    background: #0066cc;
    color: #fff;
}

.coupon-item .coupon-deal:hover {
    background: #0052a3;
    transform: scale(1.02);
}

/* Nút LẤY MÃ (code) */
.coupon-item .coupon-code {
    background: #28a745;
    color: #fff;
    position: relative;
}

.coupon-item .coupon-code:hover {
    background: #218838;
    transform: scale(1.02);
}

.coupon-item .coupon-code .code-text {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin-right: 8px;
    font-family: monospace;
    letter-spacing: 1px;
}

/* Meta info (Used times, See Details) */
.coupon-item .coupon-footer-meta {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.coupon-item .coupon-footer-meta .used-times {
    color: #666;
}

.coupon-item .coupon-footer-meta .see-details {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.coupon-item .coupon-footer-meta .see-details:hover {
    text-decoration: underline;
}

/* Icon save/favorite */
.coupon-item .coupon-save {
    cursor: pointer;
    font-size: 20px;
    color: #ccc;
    transition: all 0.3s ease;
}

.coupon-item .coupon-save:hover,
.coupon-item .coupon-save.saved {
    color: #e74c3c;
}

/* Grid layout - đồng nhất */
.coupon-listing-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.coupon-list-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.latest-coupon {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.title-sec {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.coupon-detail {
    margin-top: auto;
}

/* Expired coupon */
.coupon-expired {
    opacity: 0.6;
    position: relative;
}

.coupon-expired::after {
    content: 'HẾT HẠN';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .coupon-item .store-thumb-link {
        height: 150px;
        padding: 15px;
    }
    
    .coupon-item .coupon-title {
        min-height: 50px;
        font-size: 14px;
    }
    
    .coupon-item .coupon-button {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Fix grid columns */
@media (min-width: 769px) {
    .coupon-listing-item {
        margin-bottom: 20px;
    }
}

/* Store name badge */
.coupon-item .store-name {
    display: inline-block;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

/* Trending/Hot badge */
.coupon-item .trending-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Verified badge */
.coupon-item .verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #28a745;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.coupon-item .verified-badge i {
    font-size: 12px;
}


/* HIỂN THỊ ẢNH BANNER/LOGO */
.coupon-item .store-thumb-link .store-thumb,
.coupon-item .store-thumb-link .thumb-padding {
    display: block !important;
    width: 100%;
    height: 100%;
    background: transparent !important;
}

.coupon-item .store-thumb-link .store-thumb a,
.coupon-item .store-thumb-link .thumb-padding a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Remove tất cả background inline styles */
.coupon-item .store-thumb-link,
.coupon-item .store-thumb-link .store-thumb,
.coupon-item .store-thumb-link .thumb-padding,
.coupon-item .store-thumb-link a,
.coupon-item .store-thumb-link span {
    background-color: transparent !important;
    background-image: none !important;
}

/* FORCE: Tất cả ảnh trong trang chủ đều hiển thị đầy đủ, không cắt */
/* CHỈ áp dụng cho trang chủ, KHÔNG ảnh hưởng trang category */
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item .store-thumb-link img,
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item.has-banner .store-thumb-link img,
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item .thumb-padding img,
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item .store-thumb img {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 10px !important;
}


/* ULTRA FORCE - Ảnh featured image hiển thị full size */
/* CHỈ áp dụng cho trang chủ */
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item.has-thumb .store-thumb-link img,
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item .store-thumb-link .thumb-padding img,
body:not(.tax-coupon_category):not(.tax-coupon_store) .coupon-item .store-thumb-link .store-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: auto !important;
    min-height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    padding: 10px !important;
    display: block !important;
}
