/* 7-day price drops page */
.price-drops-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.price-drops-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.price-drops-subtitle,
.results-range,
.sort-note,
.computed-at {
    color: var(--text-secondary);
}

.price-drops-toolbar {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.price-drops-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sort-toggle .btn {
    min-width: 170px;
}

.website-filters-panel {
    position: relative;
}

.website-filters-summary {
    list-style: none;
    cursor: pointer;
}

.website-filters-summary::-webkit-details-marker {
    display: none;
}

.website-filters-summary .btn {
    min-width: 220px;
    text-align: left;
}

.website-filters-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 20;
    width: min(640px, calc(100vw - 2rem));
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.website-filter-select-all {
    margin-bottom: 0.75rem;
}

.website-filter-group + .website-filter-group {
    margin-top: 1rem;
}

.website-filter-group-title {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.website-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
}

.website-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.website-filter-item input {
    margin: 0;
}

.price-drops-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
}

.price-drop-card {
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-drop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.price-drop-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.price-drop-image {
    flex-shrink: 0;
}

.price-drop-img-container {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.price-drop-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.price-drop-img-container .no-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0.25rem;
    text-align: center;
    pointer-events: none;
    color: #6c757d;
    font-size: 0.8rem;
}

.price-drop-details {
    flex: 1;
    min-width: 0;
}

.price-drop-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-drop-product-name {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.site-display-with-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.site-badge {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-logo {
    max-height: 100px;
    width: auto;
    max-width: 120px;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 123, 255, 0.08);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.18);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.price-drop-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.metric-item {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.metric-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.metric-value {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.metric-value.metric-drop {
    color: #198754;
}

.metric-value.metric-pct {
    color: #0d6efd;
}

.price-drop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.price-drop-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.product-action-btn {
    background: linear-gradient(145deg, #ff6b00, #ff7d1a);
    color: white !important;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(255, 107, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.product-action-btn:hover {
    background: linear-gradient(145deg, #ff7d1a, #ff8c2b);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.details-btn {
    background: linear-gradient(145deg, #007bff, #0056b3) !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05) !important;
}

.details-btn:hover {
    background: linear-gradient(145deg, #0056b3, #004085) !important;
}

.no-results,
.error-message {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-message {
    color: #dc3545;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

#price-drops-wrapper {
    min-height: 100vh;
    position: relative;
    width: 100%;
}

#spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 500px;
    z-index: 10;
    background: none;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

@media (max-width: 768px) {
    .price-drops-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .price-drops-toolbar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-toggle .btn-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .sort-toggle .btn {
        min-width: 0;
    }

    .website-filters-summary .btn {
        width: 100%;
        min-width: 0;
    }

    .website-filters-popover {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 0.5rem;
    }

    .website-filters-grid {
        grid-template-columns: 1fr;
    }

    .price-drop-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .price-drop-img-container {
        width: 100%;
        height: 0;
        padding-bottom: 75%;
    }

    .price-drop-img-container img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .price-drop-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .site-display-with-logo {
        justify-content: flex-start;
        flex-shrink: 0;
    }

    .price-drop-metrics {
        grid-template-columns: 1fr;
    }

    .price-drop-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .price-drop-actions {
        width: 100%;
    }

    .product-action-btn {
        flex: 1;
    }

    #spinner {
        min-height: 350px;
    }
}
