/**
 * Deal Card Component Styles
 * Include this CSS wherever deal cards are displayed
 * Designed based on CommodityOnline style
 */

/* ===== DEAL CARD BASE ===== */
.deal-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #22c55e;
}

.deal-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ===== IMAGE SECTION ===== */
.deal-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f3f4f6;
}

.deal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.deal-card:hover .deal-card-image img {
    transform: scale(1.05);
}

/* Featured Badge */
.deal-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.deal-badge-featured {
    background: #f97316;
    color: white;
}

.deal-badge-buy {
    background: #3b82f6;
    color: white;
}

.deal-badge-sell {
    background: #22c55e;
    color: white;
}

/* Wishlist Button */
.deal-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #9ca3af;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.deal-wishlist:hover {
    transform: scale(1.1);
    color: #ef4444;
}

.deal-wishlist.active {
    color: #ef4444;
    background: #fff1f2;
}

.deal-wishlist.active i {
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ===== CONTENT SECTION ===== */
.deal-card-content {
    padding: 12px 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.deal-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.deal-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-price {
    font-size: 18px;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 10px;
}

.deal-seller {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deal-verified {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #22c55e;
    font-weight: 500;
}

.deal-verified i {
    font-size: 14px;
}

.deal-location {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deal-location i {
    color: #ef4444;
    font-size: 12px;
}

/* ===== FOOTER / CTA ===== */
.deal-card-footer {
    padding: 10px 14px;
    border-top: none;
}

.deal-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.deal-cta-btn:hover {
    background: #16a34a;
}

.deal-cta-btn i {
    font-size: 14px;
}

/* ===== MOBILE COMPACT LAYOUT ===== */
@media (max-width: 640px) {

    .deal-card,
    .deal-card-compact {
        flex-direction: row;
        border-radius: 10px;
    }

    .deal-card-link {
        flex-direction: row;
        flex: 1;
    }

    .deal-card-image {
        width: 110px;
        min-width: 110px;
        aspect-ratio: 1/1;
        border-radius: 10px 0 0 10px;
    }

    .deal-badge {
        font-size: 9px;
        padding: 3px 6px;
        top: 6px;
        left: 6px;
    }

    .deal-wishlist {
        width: 28px;
        height: 28px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }

    .deal-card-content {
        padding: 10px 12px;
        justify-content: center;
    }

    .deal-date {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .deal-title {
        font-size: 13px;
        margin-bottom: 4px;
        -webkit-line-clamp: 1;
    }

    .deal-price {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .deal-seller {
        display: none;
    }

    .deal-location {
        font-size: 11px;
    }

    .deal-card-footer {
        display: none;
    }
}

/* ===== GRID LAYOUTS ===== */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .deals-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===== FAB BUTTON (Sell/Buy) ===== */
.deal-fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 32px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.4);
    z-index: 100;
    transition: all 0.3s;
}

.deal-fab:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 10px 32px rgba(34, 197, 94, 0.5);
}

.deal-fab i {
    font-size: 18px;
}

/* ===== LOADING STATE ===== */
.deal-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.deal-card.loading .deal-wishlist i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}