/* ===== CUSTOM PROPERTIES ===== */
:root {
    --wine-primary: #722f37;
    --wine-secondary: #a94852;
    --wine-light: #f5f3f0;
    --wine-accent: #d4af37;
    --cream: #faf8f5;
    --text-dark: #2c2c2c;
    --text-muted: #6c757d;
    --border-light: #e9ecef;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.2s ease-in-out;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--cream);
}

.bg-wine {
    background-color: var(--wine-primary) !important;
}

.text-wine {
    color: var(--wine-primary) !important;
}

.btn-wine {
    background-color: var(--wine-secondary);
    border-color: var(--wine-secondary);
    color: white;
    transition: var(--transition);
}

.btn-wine:hover {
    background-color: var(--wine-primary);
    border-color: var(--wine-secondary);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-wine {
    color: var(--wine-primary);
    border-color: var(--wine-primary);
    background-color: transparent;
    transition: var(--transition);
}

.btn-outline-wine:hover {
    background-color: var(--wine-primary);
    border-color: var(--wine-primary);
    color: white;
    transform: translateY(-1px);
}

/* ===== NAVBAR ===== */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--wine-accent) !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--wine-primary) 0%, var(--wine-secondary) 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="wine-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23wine-pattern)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #fff, var(--wine-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-image-container {
    position: relative;
    height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-wine-glass {
    height: 8rem;
    width: auto;
    opacity: 0.4;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}

.hero-wine-glass:hover {
    transform: scale(1.1);
}

/* ===== SEARCH SECTION ===== */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-top: -3rem;
    position: relative;
    z-index: 2;
}

.search-tabs {
    margin-bottom: 1.5rem;
}

.search-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    border: none;
    background: none;
    transition: var(--transition);
}

.search-tabs .nav-link.active {
    color: var(--wine-primary);
    background: none;
    border-bottom: 2px solid var(--wine-primary);
}

/* ===== DEAL CARDS ===== */
.deal-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border-light);
}

.deal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.deal-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.deal-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.deal-card-body {
    padding: 1.25rem;
}

.wine-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.wine-details {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.deal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wine-primary);
}

.savings {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

.retailer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.retailer-name {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.time-remaining {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== STATS SECTION ===== */
.stats-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--wine-primary);
    display: block;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FILTER SIDEBAR ===== */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.filter-quick-actions {
    display: flex;
    gap: 0.25rem;
}

.filter-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--wine-light);
    background: linear-gradient(135deg, var(--wine-light) 0%, rgba(245, 243, 240, 0.5) 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
}

.filter-actions .btn-wine {
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.filter-actions .btn-wine:hover {
    box-shadow: var(--shadow-md);
}

.filters-active .filter-sidebar {
    border: 2px solid var(--wine-primary);
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

.filters-active .filter-title::after {
    content: " (Active)";
    color: var(--wine-primary);
    font-size: 0.8em;
    font-weight: 500;
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: #fafafa;
}

.checkbox-group .form-check {
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.checkbox-group .form-check:last-child {
    margin-bottom: 0;
}

.checkbox-group .form-check-input {
    margin-right: 0.5rem;
}

.checkbox-group .form-check-label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-dark);
}

.checkbox-group .form-check-input:checked + .form-check-label {
    color: var(--wine-primary);
    font-weight: 500;
}

/* ===== DEAL TIMELINE ===== */
.deal-timeline {
    padding: 0.5rem;
    background: var(--wine-light);
    border-radius: 6px;
    border-left: 3px solid var(--wine-primary);
}

.deal-timeline small {
    font-size: 0.8rem;
}

.deal-number {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    background: var(--border-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ===== SORT DROPDOWN ===== */
.dropdown-item.active {
    background-color: var(--wine-light);
    color: var(--wine-primary);
    font-weight: 500;
}

.dropdown-item.active:hover,
.dropdown-item.active:focus {
    background-color: var(--wine-primary);
    color: white;
}

.dropdown-item i.bi-check {
    font-weight: bold;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    color: var(--wine-primary);
    border-color: var(--border-light);
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--wine-light);
    border-color: var(--wine-primary);
    color: var(--wine-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--wine-primary);
    border-color: var(--wine-primary);
    color: white !important;
}

.pagination .page-item.active .page-link:hover {
    background-color: var(--wine-primary);
    border-color: var(--wine-primary);
    color: white !important;
}

/* ===== FORMS ===== */
.form-control:focus {
    border-color: var(--wine-primary);
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

.form-select:focus {
    border-color: var(--wine-primary);
    box-shadow: 0 0 0 0.2rem rgba(114, 47, 55, 0.25);
}

/* ===== RETAILER LOGOS ===== */
.retailer-logo {
    max-height: 24px;
    width: auto;
    object-fit: contain;
    filter: grayscale(0.2);
    transition: var(--transition);
}

.retailer-logo:hover {
    filter: grayscale(0);
    transform: scale(1.05);
}

/* ===== UTILITIES ===== */
.text-accent {
    color: var(--wine-accent) !important;
}

.bg-light-cream {
    background-color: var(--wine-light) !important;
}

.border-wine {
    border-color: var(--wine-primary) !important;
}

.shadow-wine {
    box-shadow: 0 0.5rem 1rem rgba(114, 47, 55, 0.15) !important;
}

/* ===== DUAL RANGE SLIDER ===== */
.price-range-container,
.discount-range-container {
    margin: 1rem 0;
}

.price-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.price-label {
    padding: 0.25rem 0.5rem;
    background: var(--wine-light);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.dual-range-slider {
    position: relative;
    height: 50px;
    margin: 1rem 0;
}

.range-input {
    position: absolute;
    width: 100%;
    height: 50px;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.range-input::-webkit-slider-track {
    -webkit-appearance: none;
    height: 6px;
    background: transparent;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--wine-primary);
    background: var(--wine-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3C!-- Wine glass stem and base --%3E%3Crect x='9' y='13' width='2' height='4' fill='%23d4d4d4'/%3E%3Cellipse cx='10' cy='17.5' rx='3' ry='1' fill='%23d4d4d4'/%3E%3C!-- Wine glass bowl outline --%3E%3Cpath d='M6 3 C6 3 6 7 6 9 C6 11.5 7.8 13 10 13 C12.2 13 14 11.5 14 9 C14 7 14 3 14 3 Z' fill='none' stroke='%23d4d4d4' stroke-width='1'/%3E%3C!-- Red wine inside --%3E%3Cpath d='M6.5 4 C6.5 4 6.5 7.5 6.5 8.8 C6.5 10.8 8 12 10 12 C12 12 13.5 10.8 13.5 8.8 C13.5 7.5 13.5 4 13.5 4 Z' fill='%23722f37'/%3E%3C!-- Glass rim --%3E%3Cline x1='6' y1='3' x2='14' y2='3' stroke='%23d4d4d4' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    cursor: grab;
    box-shadow: var(--shadow-md);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    position: relative;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(114, 47, 55, 0.1);
}

.range-input::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 0 0 12px rgba(114, 47, 55, 0.15);
}

.range-input::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

.range-input::-moz-range-thumb {
    pointer-events: all;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--wine-primary);
    background: var(--wine-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3C!-- Wine glass stem and base --%3E%3Crect x='9' y='13' width='2' height='4' fill='%23d4d4d4'/%3E%3Cellipse cx='10' cy='17.5' rx='3' ry='1' fill='%23d4d4d4'/%3E%3C!-- Wine glass bowl outline --%3E%3Cpath d='M6 3 C6 3 6 7 6 9 C6 11.5 7.8 13 10 13 C12.2 13 14 11.5 14 9 C14 7 14 3 14 3 Z' fill='none' stroke='%23d4d4d4' stroke-width='1'/%3E%3C!-- Red wine inside --%3E%3Cpath d='M6.5 4 C6.5 4 6.5 7.5 6.5 8.8 C6.5 10.8 8 12 10 12 C12 12 13.5 10.8 13.5 8.8 C13.5 7.5 13.5 4 13.5 4 Z' fill='%23722f37'/%3E%3C!-- Glass rim --%3E%3Cline x1='6' y1='3' x2='14' y2='3' stroke='%23d4d4d4' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    cursor: grab;
    box-shadow: var(--shadow-md);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(114, 47, 55, 0.1);
}

.range-input::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 0 0 12px rgba(114, 47, 55, 0.15);
}

.range-min {
    z-index: 5;
}

.range-max {
    z-index: 4;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
}

.slider-range {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, var(--wine-secondary), var(--wine-primary));
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
    z-index: 1;
}

/* ===== VIVINO REVIEWS ===== */
.vivino-reviews {
    font-size: 0.75rem !important;
}

/* ===== WINE BOTTLE ICON ===== */
.fa-wine-bottle {
    transform: rotate(-45deg);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .search-section {
        margin-top: -2rem;
        padding: 1.5rem;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .filter-actions {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .filter-quick-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-quick-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .deal-image {
        height: 150px;
    }

    .price-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}