/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.nav-brand .tagline {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Logo styles */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.nav-logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
}

.brand-name {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 2.5rem;
    color: #005F73;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.feature-card h3 {
    color: #005F73;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Info Section */
.info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info h3 {
    color: #005F73;
    margin-bottom: 1rem;
}

.info p {
    color: #666;
    line-height: 1.8;
}

/* Page Header */
.page-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-header h2 {
    color: #005F73;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #005F73;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #005F73;
    color: white;
}

.btn-primary:hover {
    background: #0A9396;
}

.btn-secondary {
    background: white;
    color: #005F73;
    border: 2px solid #005F73;
}

.btn-secondary:hover {
    background: #005F73;
    color: white;
}

/* Excel-like Table Container */
.table-container {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

/* Data Table - Excel Style */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.data-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
    background: #f8f9fa;
}

.data-table thead th:last-child {
    border-right: none;
}

.data-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #f1f3f5;
    color: #495057;
}

.data-table tbody td:last-child {
    border-right: none;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr.clickable-row {
    cursor: pointer;
}

.data-table tbody tr.clickable-row:hover {
    background-color: #e7f1ff;
}

/* Table Cell Specific Styles */
.brand-name,
.product-name {
    font-weight: 500;
    color: #1a1a1a;
}

.tasting-notes-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Stock Status */
.in-stock {
    color: #28a745;
    font-weight: bold;
    text-align: center;
}

.out-of-stock {
    color: #dc3545;
    font-weight: bold;
    text-align: center;
}

/* Empty State in Table */
.data-table tbody tr td.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.2rem;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state h3 {
    color: #005F73;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    /* Make tables horizontally scrollable on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px 12px;
    }

    .tasting-notes-cell {
        max-width: 200px;
    }
}

/* Sortable column styles */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: #e9ecef;
}

.sort-indicator {
    font-size: 0.8em;
    color: #005F73;
    margin-left: 4px;
}

/* Flavor Wheel Styles */
.flavor-wheel-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.wheel-info {
    margin-bottom: 2rem;
    text-align: center;
}

.wheel-info h3 {
    color: #005F73;
    margin-bottom: 1rem;
}

.wheel-info p {
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.wheel-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 1rem;
    color: #666;
}

.stat-item strong {
    font-size: 1.5rem;
    color: #005F73;
    display: block;
    margin-bottom: 0.25rem;
}

.wheel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

#flavor-wheel {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.selection-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #005F73;
    margin-top: 2rem;
}

.selection-info h3 {
    color: #005F73;
    margin-bottom: 0.5rem;
}

.selection-info p {
    color: #666;
    margin-bottom: 1rem;
}

/* Products Section */
.products-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    color: #005F73;
    font-size: 1.5rem;
}

.section-header .search-input {
    flex: 0 1 300px;
}

/* Product Table Styles */
#products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#products-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

#products-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
}

#products-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #f1f3f5;
    color: #495057;
}

/* Column widths for products table */
#products-table th:nth-child(8),
#products-table td:nth-child(8) {
    /* Price column - wider for price variants */
    min-width: 120px;
}

/* Price mini-table inside product table */
.price-cell {
    padding: 4px !important;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.price-table td {
    padding: 2px 6px !important;
    border: none !important;
    background: transparent !important;
}

.price-table td:first-child {
    /* Size column */
    color: #555;
    white-space: nowrap;
}

.price-table td:last-child {
    /* Price column */
    text-align: right;
    color: #005F73;
    font-weight: 600;
    white-space: nowrap;
}

#products-table th:nth-child(9),
#products-table td:nth-child(9) {
    /* Stock column - narrower, just checkmark */
    width: 50px;
    text-align: center;
}

#products-table tbody tr {
    transition: background-color 0.15s;
}

#products-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Flavor Tags */
.flavor-tag {
    display: inline-block;
    background: #e7f3ff;
    color: #0066cc;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Stock Badges */
.stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-badge.out-stock {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive Flavor Wheel */
@media (max-width: 768px) {
    .wheel-stats {
        gap: 1rem;
    }

    .stat-item strong {
        font-size: 1.2rem;
    }

    #flavor-wheel svg {
        width: 100% !important;
        height: auto !important;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header .search-input {
        flex: 1;
        width: 100%;
    }

    #products-table {
        font-size: 0.8rem;
    }

    #products-table thead th,
    #products-table tbody td {
        padding: 8px 10px;
    }
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.breadcrumb-item {
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

/* Arc Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.arc.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Arc Hover Effect */
.arc {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow Effect for Selected Arc */
.arc.selected {
    filter: drop-shadow(0 0 8px currentColor);
    opacity: 1 !important;
}

/* Center Circle Hover Effect */
.center-circle {
    transition: all 0.2s;
}

.center-circle:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Enhanced Tooltip Styles */
.wheel-tooltip {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    max-width: 280px;
}

.wheel-tooltip strong {
    display: block;
    margin-bottom: 4px;
}

/* Zoom Animation */
@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 0.9;
    }
}

@keyframes zoomOut {
    from {
        transform: scale(1.2);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 0.9;
    }
}

.arc.zooming-in {
    animation: zoomIn 0.5s ease-out;
}

.arc.zooming-out {
    animation: zoomOut 0.5s ease-out;
}

/* Smooth Transitions for all SVG elements */
#flavor-wheel svg * {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Loading Spinner Enhancement */
.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid rgba(107, 68, 35, 0.3);
    border-top-color: #005F73;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Breadcrumb */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    .wheel-tooltip {
        max-width: 200px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ============================================ */
/* FLAVOR GRID STYLES (Replacing D3 Wheel) */
/* ============================================ */

/* Full page grid - no frame boundaries */
.flavor-split-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: auto;
    width: 100%;
    padding: 2rem 0;
}

.flavor-grid-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
    min-height: auto;
}

.flavor-grid {
    display: grid;
    justify-content: center;
    align-content: center;
}

/* Individual Cell Styles */
.flavor-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.flavor-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.flavor-cell.hovered {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Correlation Highlight */
.flavor-cell.correlated {
    animation: pulse 1.5s ease-in-out infinite;
    border: 2px solid #FFD700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* Selected Flavor Highlight (clicked item) */
.flavor-cell.selected {
    animation: pulse 1.5s ease-in-out infinite;
    border: 2px solid #FFD700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
    position: relative;
}

/* Add a "selected" badge to the selected cell */
.flavor-cell.selected::before {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 4px;
    color: #FFD700;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Cell Label */
.cell-label {
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    padding: 4px;
    word-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}

/* Center Cell Special Style */
.center-cell {
    background: #005F73 !important;
    font-size: 14px;
    font-weight: bold;
}

.center-cell .cell-label {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Cells */
.category-cell {
    font-weight: bold;
}

.category-cell .cell-label {
    font-size: 10px;
    text-transform: uppercase;
}

/* Flavor Cells */
.flavor-cell {
    cursor: pointer;
}

/* Products Panel at Bottom */
.products-panel-bottom {
    width: 100%;
    max-width: 100%;
    background: white;
    border-top: 3px solid #005F73;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    border-radius: 8px 8px 0 0;
    transition: box-shadow 0.3s ease, border-top-color 0.3s ease;
}

/* Flash indicator animation */
.products-panel-bottom.flash-indicator {
    animation: flash-border 2s ease-in-out;
}

@keyframes flash-border {
    0%, 100% {
        border-top-color: #005F73;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }
    25% {
        border-top-color: #FFD700;
        box-shadow: 0 -8px 24px rgba(255, 215, 0, 0.6);
    }
    50% {
        border-top-color: #005F73;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }
    75% {
        border-top-color: #FFD700;
        box-shadow: 0 -8px 24px rgba(255, 215, 0, 0.6);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.panel-header h3 {
    color: #005F73;
    font-size: 1.25rem;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.3s;
}

.btn-close:hover {
    color: #E74C3C;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    max-height: 500px; /* Fixed height for scrollable area */
}

.panel-content .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-content .section-header p {
    color: #666;
    margin: 0;
}

.product-count {
    font-weight: 600;
    color: #005F73;
}

.panel-content .search-input {
    width: 100%;
    margin-bottom: 1rem;
}

.panel-content .table-container {
    max-height: none;
}

.panel-content #products-table {
    font-size: 0.85rem;
}

.panel-content #products-table th,
.panel-content #products-table td {
    padding: 8px 10px;
}

/* Product link styling */
.product-link {
    color: #005F73;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.product-link:hover {
    color: #0A9396;
    text-decoration: underline;
}

.product-link:visited {
    color: #5A3820;
}

/* Compact flavor tags in panel */
.panel-content .flavor-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
}

.flavors-cell {
    max-width: 150px;
}

/* Responsive Grid Layout */
@media (max-width: 1400px) {
    .products-panel {
        width: 95%;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .flavor-grid-wrapper {
        padding: 1rem;
    }

    .flavor-cell {
        font-size: 0.8rem;
    }

    .products-panel {
        width: 95%;
        max-height: 80vh;
    }

    .panel-content {
        padding: 1rem;
    }
}

/* ============================================ */
/* MAP ANIMATIONS */
/* ============================================ */

/* Origin marker highlighting animation */
@keyframes originBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.origin-highlighted {
    animation: originBlink 1s ease-in-out infinite;
}

/* Connection lines from brand to origins */
.connection-line {
    pointer-events: none;
}

@keyframes connectionDash {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 20;
    }
}

.leaflet-pane .connection-line path {
    animation: connectionDash 1s linear infinite;
}

/* Country boundary hover effect */
.country-boundary-hover {
    stroke-width: 3 !important;
    stroke: #FFD700 !important;
    fill: rgba(255, 215, 0, 0.2) !important;
}

/* Weather Chart Popup Styles */
.leaflet-popup.weather-chart-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup.weather-chart-popup .leaflet-popup-content {
    margin: 0;
    max-width: 800px;
    min-width: 700px;
}

.weather-popup {
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.weather-popup-header {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #005F73;
    padding-bottom: 1rem;
}

.weather-popup-header h3 {
    color: #005F73;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.weather-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.weather-chart-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.weather-tab {
    background: #f5f5f5;
    border: 2px solid #ddd;
    color: #333;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.weather-tab:hover {
    background: #e0e0e0;
    border-color: #999;
}

.weather-tab.active {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    border-color: #005F73;
}

.weather-chart-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weather-popup-error {
    padding: 2rem;
    text-align: center;
}

.weather-popup-error h3 {
    color: #005F73;
    margin-bottom: 1rem;
}

.weather-popup-error p {
    color: #666;
    margin-bottom: 0.5rem;
}

/* Country Flavor Labels */
.country-flavor-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    pointer-events: auto !important; /* Changed to allow button clicks */
    white-space: nowrap;
    z-index: 650 !important; /* Above markers to make climate button clickable */
}

.country-flavor-label::before {
    display: none !important;
}

.country-flavor-label * {
    pointer-events: none !important;
}

.flavor-label-content {
    text-align: center;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.8);
    pointer-events: none !important;
    position: relative;
    z-index: 650 !important; /* Ensure content is clickable */
}

.flavor-label-content .country-name {
    font-weight: bold;
    font-size: 11px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #005F73;
    pointer-events: none !important;
}

.flavor-label-content .flavor-list {
    font-size: 9px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
    pointer-events: none !important;
}

/* Climate Button (in flavor label) */
.flavor-label-content .climate-btn {
    pointer-events: auto !important; /* Override to allow clicks */
    background: linear-gradient(135deg, #4A90E2, #67B0E8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    margin-top: 3px;
    display: inline-block;
    position: relative;
    z-index: 1000 !important; /* Highest z-index for clickability */
}

.flavor-label-content .climate-btn:hover {
    background: linear-gradient(135deg, #357ABD, #5AA3E0);
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    z-index: 1001 !important; /* Even higher on hover */
}

/* Map Marker Z-Index and Pointer Events */
/* SVG elements (circleMarkers) need special handling for z-index */
.leaflet-pane.leaflet-marker-pane {
    z-index: 600 !important; /* Ensure marker pane is above other panes */
}

.leaflet-pane.leaflet-shadow-pane {
    z-index: 500 !important;
}

.leaflet-pane.leaflet-overlay-pane {
    z-index: 400 !important;
    pointer-events: none !important; /* Country boundaries don't block clicks */
}

/* Allow country boundaries to receive hover events, but not block tooltips */
.leaflet-pane.leaflet-overlay-pane svg,
.leaflet-pane.leaflet-overlay-pane path {
    pointer-events: visiblePainted !important; /* Only respond on visible strokes/fills */
}

.leaflet-pane.leaflet-tooltip-pane {
    z-index: 700 !important; /* Country labels above markers for climate button clickability */
    pointer-events: none !important; /* Tooltips don't block by default */
}

/* Allow interactive elements inside tooltips to receive clicks */
.leaflet-tooltip.country-flavor-label {
    pointer-events: auto !important;
}

/* Origin markers - highest priority (SVG circles) */
path.origin-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

svg path.origin-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Producer markers */
path.producer-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

svg path.producer-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Brand markers (div icons) */
.brand-square-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure origin markers are highlighted on hover */
.origin-marker:hover {
    opacity: 1 !important;
    stroke-width: 3 !important;
}

.origin-highlighted {
    animation: blink 0.5s ease-in-out;
}

@keyframes blink {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Fix for SVG element ordering - bring origins to front */
.leaflet-marker-pane svg g path.origin-marker {
    paint-order: stroke fill markers;
}

/* Make origin markers slightly larger on hover for easier clicking */
.origin-marker:hover {
    r: 8 !important; /* Increase radius on hover */
}

/* ============================================ */
/* CHATBOT STYLES */
/* ============================================ */

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 999;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 450px;
    height: 600px;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-radius: 12px 0 0 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chat-panel.collapsed {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 0 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    margin-bottom: 0.6rem;
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.system-message {
    align-self: center;
    max-width: 90%;
}

.message-text {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.user-message .message-text {
    background: #4A90E2;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-text {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.system-message .message-text {
    background: #fff3cd;
    color: #856404;
    font-size: 0.85rem;
    text-align: center;
    font-style: italic;
}

/* Product info card (from Ask Chatbot redirect) */
.product-info-card {
    max-width: 90%;
}

.product-info-card .message-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.product-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.product-info-header strong {
    font-size: 1.1rem;
    color: #005F73;
}

.view-product-link {
    font-size: 0.8rem;
    color: #0A9396;
    text-decoration: none;
}

.view-product-link:hover {
    text-decoration: underline;
}

.product-details-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.product-details-list li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.product-details-list li strong {
    color: #495057;
}

.product-info-prompt {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: #666;
}

/* Loading indicator - animated dots (no bubble) */
.loading-indicator {
    padding: 0.5rem 0;
    color: #005F73;
}

.loading-indicator span {
    display: inline-block;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    animation: loadingDot 1.4s infinite;
}

.loading-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        opacity: 0.2;
    }
    40% {
        opacity: 1;
    }
}

/* Chat Products - Compact Table Layout */
.chat-products-table-container {
    margin-top: 0.5rem;
    margin-bottom: 0.6rem;
    overflow-x: auto;
}

.chat-products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.85rem;
}

.chat-products-table thead {
    background: #005F73;
    color: white;
}

.chat-products-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 2px solid #0A9396;
}

.chat-products-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.chat-products-table tbody tr:hover {
    background-color: #f8f9fa;
}

.chat-products-table tbody tr:last-child {
    border-bottom: none;
}

.chat-products-table td {
    padding: 0.5rem;
    vertical-align: top;
}

/* Product name cell */
.product-name-cell {
    min-width: 180px;
}

.product-name-link {
    text-decoration: none;
    color: #005F73;
    font-weight: 600;
    transition: color 0.3s;
}

.product-name-link:hover {
    color: #0A9396;
    text-decoration: underline;
}

.brand-name {
    color: #999;
    font-size: 0.75rem;
}

/* Reason row (spans all columns for better readability) */
.chat-product-reason-row {
    background-color: #f9f6f3;
    border-top: none !important;
}

.product-reason-cell {
    padding: 0.5rem 0.75rem !important;
    border-top: none !important;
    border-bottom: 1px solid #e0d5c7 !important;
}

.product-reason-text {
    color: #005F73;
    font-size: 0.85rem;
    font-style: italic;
    display: block;
    line-height: 1.4;
}

/* Price cell */
.price-cell {
    font-weight: 600;
    color: #005F73;
    white-space: nowrap;
    text-align: right;
}

/* Origin cell */
.origin-cell {
    color: #555;
    white-space: nowrap;
}

/* Roast cell */
.roast-cell {
    color: #555;
    white-space: nowrap;
}

/* Flavors cell */
.flavors-cell {
    color: #666;
    font-size: 0.8rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions cell */
.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.btn-similar-compact {
    background: white;
    color: #005F73;
    border: 1px solid #005F73;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-similar-compact:hover {
    background: #005F73;
    color: white;
}

/* Legacy card styles (kept for backward compatibility) */
.btn-view,
.btn-similar {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-view {
    background: #005F73;
    color: white;
}

.btn-view:hover {
    background: #0A9396;
}

.btn-similar {
    background: white;
    color: #005F73;
    border: 1px solid #005F73;
}

.btn-similar:hover {
    background: #005F73;
    color: white;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .chat-products-table {
        font-size: 0.75rem;
    }

    .chat-products-table th,
    .chat-products-table td {
        padding: 0.4rem;
    }

    .product-name-cell {
        min-width: 120px;
    }

    .flavors-cell {
        max-width: 120px;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.75rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.3s;
}

#chat-input:focus {
    outline: none;
    border-color: #005F73;
}

.btn-send {
    background: #005F73;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-send:hover:not(:disabled) {
    background: #0A9396;
}

.btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* "Ask Chatbot" Button in Product Table */
.btn-chat {
    background: #005F73;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-chat:hover {
    background: #0A9396;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Quick Actions (Grok-generated suggestions) */
.chat-quick-actions {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #005F73;
}

.quick-actions-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #005F73;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: white;
    color: #005F73;
    border: 1px solid #005F73;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.quick-action-btn:hover {
    background: #005F73;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 68, 35, 0.3);
}

/* Main Chat Interface (Center of Page) */
.chat-main-container {
    max-width: 900px;
    margin: 2rem auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-main-header {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.chat-main-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.chat-subtitle {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.6;
}

.btn-clear-conversation {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-clear-conversation:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.chat-messages-main {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 2rem;
    background: #f8f9fa;
}

.chat-input-main-container {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-wrapper #chat-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    transition: border-color 0.3s;
    min-height: 60px;
}

.chat-input-wrapper #chat-input:focus {
    outline: none;
    border-color: #005F73;
}

.btn-send-main {
    background: #005F73;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-send-main:hover:not(:disabled) {
    background: #0A9396;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 68, 35, 0.3);
}

.btn-send-main:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-send-main .btn-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Browse All Section */
.browse-all-section {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
}

.browse-all-section p {
    color: #666;
    margin-bottom: 1rem;
}

/* Inline Chat Search (replacing search bar in brands.html) */
.chat-search-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.chat-search-header {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-search-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-clear-inline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-clear-inline:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages-inline {
    max-height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    min-height: 200px;
}

.chat-input-inline-container {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-inline-container #chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.3s;
}

.chat-input-inline-container #chat-input:focus {
    outline: none;
    border-color: #005F73;
}

.btn-send-inline {
    background: #005F73;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-send-inline:hover:not(:disabled) {
    background: #0A9396;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(107, 68, 35, 0.3);
}

.btn-send-inline:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Chatbot */
@media (max-width: 768px) {
    .chat-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-main-container {
        margin: 1rem;
        border-radius: 12px;
    }

    .chat-main-header h2 {
        font-size: 1.5rem;
    }

    .chat-messages-main {
        min-height: 300px;
        max-height: 400px;
    }

    .btn-clear-conversation {
        position: static;
        display: block;
        margin: 1rem auto 0;
    }
}

/* ==================== Product Detail Page ==================== */

/* Hero Section */
.product-hero {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.product-breadcrumb {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.breadcrumb-link {
    color: #005F73;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #999;
}

.product-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.product-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 68, 35, 0.3);
}

.btn-secondary {
    background: white;
    color: #005F73;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #005F73;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #005F73;
    color: white;
}

/* Main Content Grid */
.product-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Detail Cards */
.detail-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.detail-card-title {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flavor-wheel-link,
.map-link {
    font-size: 0.875rem;
    color: #005F73;
    text-decoration: none;
    font-weight: normal;
}

.flavor-wheel-link:hover,
.map-link:hover {
    text-decoration: underline;
}

/* Product Details Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: #333;
}

.detail-value.in-stock {
    color: #28a745;
}

.detail-value.out-of-stock {
    color: #dc3545;
}

/* Flavor Badges */
.flavor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flavor-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.flavor-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Tasting Notes */
.tasting-notes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tasting-note-item {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #333;
    border: 1px solid #e0e0e0;
}

/* Product Description */
.product-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.description-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.description-list li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Mini Map */
.product-mini-map {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

/* Related Products */
.related-products-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-product-card {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.related-product-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-product-name {
    color: #005F73;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.related-product-name:hover {
    text-decoration: underline;
}

.related-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
}

.related-product-price {
    font-weight: 600;
    color: #333;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 2rem 0;
}

/* Product name link in table */
.product-name-link {
    color: #005F73;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.product-name-link:hover {
    color: #0A9396;
    text-decoration: underline;
}

/* Action buttons in product table */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-action {
    padding: 0.375rem 0.75rem;
    background: #005F73;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    background: #0A9396;
    transform: translateY(-1px);
}

/* Small action buttons for compact tables (flavor wheel) */
.btn-action-sm {
    padding: 0.25rem 0.5rem;
    background: #005F73;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: inline-block;
}

.btn-action-sm:hover {
    background: #0A9396;
    transform: scale(1.1);
}

/* Responsive Design for Product Detail */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ==================== Full-Page Chat ==================== */

.chat-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    max-height: calc(100vh - 280px);
}

.chat-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.chat-container-header span {
    font-weight: 600;
    color: #005F73;
    font-size: 1rem;
}

.btn-clear-fullpage {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-clear-fullpage:hover {
    background: #e0e0e0;
    color: #333;
}

.chat-messages-fullpage {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
    min-height: 300px;
}

.chat-messages-fullpage .chat-message.bot-message:first-child .message-text ul {
    margin: 0.75rem 0 0 1.25rem;
    padding: 0;
}

.chat-messages-fullpage .chat-message.bot-message:first-child .message-text li {
    margin-bottom: 0.5rem;
    color: #666;
}

.chat-input-fullpage-container {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-fullpage-container #chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    transition: border-color 0.3s;
}

.chat-input-fullpage-container #chat-input:focus {
    outline: none;
    border-color: #005F73;
}

.btn-send-fullpage {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-send-fullpage:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.3);
}

.btn-send-fullpage:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ==================== Brands Page - New Products Section (Compact & Collapsible) ==================== */

.new-products-section-compact {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.section-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.section-header-compact:hover {
    background: #f8f9fa;
}

.section-header-compact .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header-compact .collapse-icon {
    color: #666;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.section-header-compact .collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.section-header-compact h3 {
    margin: 0;
    color: #005F73;
    font-size: 0.95rem;
    font-weight: 600;
}

.badge-small {
    background: #0A9396;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.new-products-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 0 1rem 1rem 1rem;
}

.new-products-scroll.collapsed {
    display: none;
}

.new-product-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.new-product-card:hover {
    border-color: #0A9396;
    box-shadow: 0 2px 6px rgba(10, 147, 150, 0.15);
}

.new-product-card .product-name {
    font-weight: 600;
    color: #005F73;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}

.new-product-card .product-name:hover {
    text-decoration: underline;
}

.new-product-card .product-brand {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.new-product-card .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.7rem;
}

.new-product-card .product-meta span {
    background: white;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.new-product-card .product-price {
    color: #005F73;
    font-weight: 600;
}

.new-product-card .product-origin {
    color: #666;
}

.new-product-card .product-date {
    color: #999;
    font-size: 0.65rem;
    margin-top: 0.35rem;
}

/* ==================== Brands Page - Search & Suggest ==================== */

.brands-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 0.75rem center;
}

.search-input:focus {
    outline: none;
    border-color: #005F73;
}

.btn-suggest-brand {
    background: linear-gradient(135deg, #94D2BD 0%, #0A9396 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-suggest-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 147, 150, 0.3);
}

.btn-ai-chat {
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ai-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.3);
    color: white;
}

/* ==================== Modal Styles ==================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    color: #005F73;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #005F73;
}

.recaptcha-container {
    margin: 1.25rem 0;
}

.btn-submit-suggestion {
    width: 100%;
    background: linear-gradient(135deg, #005F73 0%, #0A9396 100%);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit-suggestion:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.3);
}

.btn-submit-suggestion:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==================== Responsive Full-Page Chat ==================== */

@media (max-width: 768px) {
    .chat-page-container {
        height: calc(100vh - 80px);
        padding: 0.5rem;
    }

    .chat-fullpage-header {
        padding: 0.75rem 1rem;
        border-radius: 8px 8px 0 0;
    }

    .chat-fullpage-header h2 {
        font-size: 1.25rem;
    }

    .chat-messages-fullpage {
        padding: 1rem;
    }

    .chat-input-fullpage-container {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .chat-input-fullpage-container #chat-input {
        width: 100%;
    }

    .btn-send-fullpage {
        width: 100%;
    }

    .brands-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        min-width: auto;
    }

    .brands-toolbar-buttons {
        display: flex;
        gap: 0.75rem;
    }

    .btn-suggest-brand,
    .btn-ai-chat {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}
