/* ==========================================================================
   1. MASONRY GRID LAYOUT
   ========================================================================== */
.deals-masonry-grid {
    gap: 16px;
    width: 100%;
}
.deals-masonry-grid.columns-2 { column-count: 2; }
.deals-masonry-grid.columns-3 { column-count: 3; }
.deals-masonry-grid.columns-4 { column-count: 4; }

@media (max-width: 1024px) {
    .deals-masonry-grid { column-count: 3 !important; }
}
@media (max-width: 768px) {
    .deals-masonry-grid { column-count: 2 !important; }
}
@media (max-width: 480px) {
    .deals-masonry-grid { column-count: 1 !important; }
}

/* ==========================================================================
   2. CARD ITEM CONTAINER (FIXED SYSTEM FOR EQUAL DYNAMIC FOOTERS)
   ========================================================================== */
.deal-card-item {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100%;
}

/* ==========================================================================
   3. IMAGE WRAPPER & HOVER OVERLAY SYSTEM
   ========================================================================== */
.deal-card-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f7f7f7;
}
.deal-card-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.deal-badge {
    position: absolute;
    top: 12px;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 100px;
    z-index: 2;
}
.discount-badge {
    left: 12px;
    background-color: #e60023;
    color: #ffffff;
}
.brand-badge {
    right: 12px;
    background-color: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 8px !important;
    padding: 2px 8px !important;
}
.deal-card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    padding-bottom: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}
.deal-card-item:hover .deal-card-hover-overlay {
    opacity: 1;
}

/* ==========================================================================
   4. TEXT DETAILS & META FOOTER (COMPACT EXTRACTION MECHANISM)
   ========================================================================== */
.deal-card-details { 
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.deal-card-title { margin: 16px 0 10px 0; font-size: 24px; font-weight: 700; line-height: 1.2; }
.deal-card-title a { color: #111111; text-decoration: none; }
.deal-card-pricing { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.current-price { font-size: 24px; font-weight: 700; color: #e60023; }
.original-price { font-size: 22px; color: #000000; }
.savings-badge { background-color: #e6f7ed; color: #0da751; font-size: 14px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }

/* Dynamic bottom cleanup eliminates structural gaps */
.deal-card-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px solid #f5f5f5; 
    padding-top: 12px; 
    font-size: 12px; 
    color: #666666;
    margin-top: 4px;
}
.deal-source { display: flex; align-items: center; gap: 6px; }
.source-favicon { width: 18px; height: 18px; background: #eeeeee; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 10px; color: #333333; }
.deal-expiry { display: flex; align-items: center; gap: 4px; color: #d97706; font-weight: 500; }

/* ==========================================================================
   5. FILTER BAR STYLING
   ========================================================================== */
.deals-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; justify-content: flex-start; }
.deal-filter-btn { background-color: #f3f4f6; color: #4b5563; border: none; padding: 8px 16px; font-size: 14px; font-weight: 600; border-radius: 20px; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.deal-filter-btn:hover { background-color: #e5e7eb; color: #1f2937; }
.deal-filter-btn.active { background-color: #111111; color: #ffffff; }

/* Inline top verification and type metrics layout */
.deal-top-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.deal-type-tag {
    font-size: 14px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 50px;
    background-color: #f5f5f5;
    color: #000000;
    text-transform: uppercase;
}
.verified-icon {
    color: #0da751;
}
.verified-icon-container{
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 2px 12px;
    border-radius: 50px;
    background-color: #09ba4c;
    color: #ffffff; 
    text-transform: uppercase;
}

/* Stacked positioning utility for the Hot Deal badge below the main discount badge */
.hot-ribbon-stacked {
    position: absolute;
    top: 50px; 
    left: 12px;
    background-color: #000000;
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 12px;
    border-radius: 20px;
    z-index: 4;
}

/* Coupon dashed visual block properties */
.deal-coupon-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed #d1d5db;
    background-color: #f9fafb;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.coupon-txt {
    font-family: monospace;
    font-weight: bold;
    font-size: 16px;
    color: #374151;
}
.coupon-copy-btn {
    font-size: 14px;
    font-weight:500;
    background: #111;
    color: #fff;
    padding: 2px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right:-6px;
}

/* ==========================================================================
   6. CUSTOM HOVER BUTTONS & LOGO ISOLATION SCHEMES
   ========================================================================== */
.deal-source-container-wrap {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.store-logo-img {
    object-fit: contain !important;
    display: block !important;
    width: 100px !important;
    height: auto !important;
}

/* * FIXES ITEM 2 & 3: Match heights exactly, apply explicit display properties, 
 * line-height adjustments, and integrate new colors.
 */
.btn-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
    height: 40px !important; /* Explicitly guarantees uniform matching heights */
    line-height: 1 !important;
    text-decoration: none !important;
}

/* Save Action Button UI Style rules */
.btn-action.btn-save {
    background-color: #fff !important;
    color: #000 !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 8px 24px !important;
    border: none !important;
    cursor: pointer;
}
.btn-action.btn-save:hover {
    background-color: #ff0079 !important;
    color: #fff !important;
}

/* Shop Now Outbound Affiliate Redirect Link UI Style rules */
.btn-action.btn-shop {
    background-color: #ff4800 !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 8px 24px !important;
    border: none !important;
}
.btn-action.btn-shop:hover {
    background-color: #000 !important;
    color: #fff !important;
}