/* CheapKC deal listing & detail styles */

.deal-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--card-bg);
    transition: box-shadow 0.2s;
}

.deal-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.deal-card.deal-expired {
    border: 2px solid #dc3545;
    opacity: 0.92;
}

.deal-card.deal-expired:hover {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.18);
}

.deal-detail-card.deal-expired {
    border: 2px solid #dc3545 !important;
    overflow: hidden;
}

.expired-banner {
    background: #dc3545;
    color: #fff;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.35rem 0.5rem;
}

.deal-card-inner {
    padding: 1rem;
}

.deal-card-layout {
    display: flex;
    gap: 0.75rem;
}

.deal-votes {
    min-width: 52px;
    text-align: center;
    background: var(--color-gray-100);
    border-radius: 6px;
    padding: 0.5rem 0.35rem;
    flex-shrink: 0;
}

.deal-votes .vote-count {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--color-blue);
    line-height: 1.2;
}

.vote-btn {
    cursor: pointer;
    padding: 0.2rem;
    border: none;
    background: none;
    line-height: 1;
    transition: color 0.2s, transform 0.15s;
}

.vote-btn:hover {
    color: var(--color-blue);
    transform: scale(1.1);
}

.vote-btn.active-up {
    color: #28a745;
}

.vote-btn.active-down {
    color: #dc3545;
}

.deal-image-wrap {
    position: relative;
    flex-shrink: 0;
}

.deal-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.deal-price-unit-select {
    flex: 0 0 6.5rem;
    max-width: 6.5rem;
}

.deal-image-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 6px;
    background: var(--color-gray-100);
}

.deal-image-fallback {
    object-fit: contain;
    background: var(--color-gray-100);
    padding: 0.35rem;
}

.savings-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #28a745;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    line-height: 1.2;
    z-index: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.savings-badge-lg {
    display: inline-block;
    background: #28a745;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    vertical-align: middle;
}

.deal-price {
    color: var(--color-blue);
    font-weight: bold;
    font-size: 1.25rem;
}

.deal-original-price {
    text-decoration: line-through;
    color: var(--color-gray);
    font-size: 0.9rem;
}

.deal-savings {
    color: #28a745;
    font-weight: bold;
}

.category-badge {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
}

.category-badge:hover {
    background: var(--color-blue);
    color: #fff;
}

.category-badge.active {
    background: var(--color-blue);
    color: #fff;
}

.featured-deal {
    border-left: 4px solid var(--color-blue);
}

.sort-btn.active {
    background: var(--color-blue);
    color: #fff;
}

.badge-epic { background: #dc3545; animation: deal-pulse 2s infinite; }
.badge-great { background: #ffc107; color: #000; }
.badge-good { background: #1a73e8; }

@keyframes deal-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.store-link {
    color: var(--color-gray-700);
}

.store-link:hover {
    color: var(--color-blue);
    text-decoration: underline;
}

.deal-detail-card .deal-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

.deal-detail-card .deal-image-fallback {
    max-height: 320px;
    object-fit: contain;
    background: var(--color-gray-100);
    padding: 1rem;
    border-radius: 8px;
}

.deal-detail-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.comment-card {
    border-left: 3px solid var(--color-gray-300);
}

.comment-card:hover {
    border-left-color: var(--color-blue);
}

.reply-card {
    border-left: 3px solid var(--color-gray-200);
    margin-left: 2rem;
}

.category-hero {
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
    color: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.store-header {
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
    color: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Deal type & category filters */
.deal-type-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.deal-type-tabs .nav-link.active {
    color: var(--color-blue);
    font-weight: 600;
}

.category-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.category-chip {
    white-space: nowrap;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    background: var(--color-gray-200);
    color: var(--color-gray-700);
    border: 1px solid transparent;
    flex-shrink: 0;
}

.category-chip:hover,
.category-chip.active {
    background: var(--color-blue);
    color: #fff;
}

/* KC branding */
.navbar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex-shrink: 1;
}

.site-navbar .navbar-collapse {
    gap: 0.75rem;
}

.site-navbar .navbar-nav .nav-link.active {
    color: #fff;
    font-weight: 600;
}

.navbar-actions {
    width: 100%;
}

@media (min-width: 1200px) {
    .navbar-actions {
        width: auto;
        flex-wrap: nowrap !important;
    }
}

.nav-search-form {
    width: 11rem;
    max-width: 100%;
}

.nav-search-form .form-control {
    min-width: 0;
}

.nav-icon-btn,
.nav-account-btn {
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

.nav-account-btn.dropdown-toggle::after {
    margin-left: 0.35em;
}

.nav-username {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.nav-notif-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    border: 1px solid #202124;
}

@media (max-width: 1199.98px) {
    .site-navbar .navbar-actions {
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
    }

    .site-navbar .nav-search-form {
        width: 100%;
    }
}

.brand-tagline {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.15;
    font-weight: 400;
}

.brand-accent {
    color: var(--kc-gold, #e8b923);
}

:root {
    --kc-gold: #e8b923;
}

[data-theme="dark"] .deal-card,
[data-theme="dark"] .coupon-card {
    background-color: var(--card-bg) !important;
}

[data-theme="dark"] mark {
    background-color: #664d03;
    color: #ffda6a;
}

[data-theme="dark"] .category-chip {
    background: #3a3a3a;
    color: var(--text-primary);
}

[data-theme="dark"] .category-chip:hover,
[data-theme="dark"] .category-chip.active {
    background: var(--color-blue);
    color: #fff;
}

/* Mobile: stacked deal cards */
@media (max-width: 768px) {
    .deal-card-layout {
        flex-direction: column;
    }

    .deal-votes-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        order: 2;
    }

    .deal-votes-row .deal-votes {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        min-width: auto;
        padding: 0.25rem 0.5rem;
    }

    .deal-votes-row .deal-votes .vote-count {
        font-size: 1.1rem;
        min-width: 1.5rem;
    }

    .deal-image-wrap,
    .deal-image,
    .deal-image-placeholder {
        width: 100%;
        height: 180px;
    }

    .deal-card-layout .deal-image-wrap {
        order: 1;
    }

    .deal-card-layout .flex-grow-1 {
        order: 3;
    }

    .deal-votes.d-md-none {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    .deal-votes.d-md-none .vote-count {
        font-size: 1.1rem;
        min-width: 1.5rem;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .category-chips-mobile {
        display: none !important;
    }
}

.weekly-ad-card {
    transition: box-shadow 0.2s, transform 0.15s;
    border: 1px solid var(--border-color);
}

.weekly-ad-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.deal-feedback .feedback-btn {
    margin-right: 0.35rem;
}

.contact-honeypots {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.deal-day-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color, #dee2e6);
}

.deal-day-heading:first-child {
    margin-top: 0;
}

.plain-text-content {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.plain-text-content br:last-child {
    display: none;
}

.deal-submitter-link {
    color: inherit;
}

.deal-submitter-link:hover {
    color: var(--color-blue);
    text-decoration: underline !important;
}

.member-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-200, #dee2e6);
}

.member-avatar {
    font-size: 3rem;
    color: var(--color-blue);
    line-height: 1;
}
