@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

:root {
    --cream: #FDF6E3;
    --cream-dark: #F3EAD0;
    --amber: #C87A2C;
    --amber-light: #E8A84C;
    --burgundy: #6B1D2F;
    --burgundy-dark: #4A1522;
    --olive: #4A5D23;
    --olive-light: #6B7B43;
    --brown: #3D2B1F;
    --brown-light: #5C4333;
    --gold: #B8960F;
    --gold-light: #D4B83C;
    --charcoal: #1E1B18;
    --text: #2C2416;
    --text-light: #6B6050;
    --bg: #FEFCF5;
    --card-bg: #FFFDF7;
    --border: #E8DFC8;
    --shadow: 0 2px 12px rgba(61, 43, 31, 0.08);
    --shadow-lg: 0 8px 32px rgba(61, 43, 31, 0.12);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(200, 122, 44, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(74, 93, 35, 0.04) 0%, transparent 60%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
    background: var(--charcoal);
    border-bottom: 3px solid var(--amber);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--cream);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color var(--transition);
}
.nav-brand:hover { color: var(--amber-light); }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
    color: #C4B89A;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color var(--transition);
    position: relative;
}
.nav-links a:hover { color: var(--cream); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--amber);
    transition: width var(--transition);
}
.nav-links a:hover::after { width: 100%; }

/* ---- CONTAINER ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
}

/* ---- HERO ---- */
.hero {
    text-align: center;
    padding: 56px 24px 40px;
    position: relative;
}

.hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--burgundy);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 8px;
}
.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 28px;
    font-style: italic;
}

.search-box {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.search-box input[type="text"] {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--card-bg);
    color: var(--text);
    transition: all var(--transition);
    outline: none;
}
.search-box input[type="text"]:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(200, 122, 44, 0.1);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
}
.search-dropdown.active { display: block; }
.search-dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: pointer;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover, .search-dropdown-item.selected { background: var(--cream); }
.search-dropdown-item strong { color: var(--burgundy); display: block; font-size: 0.95rem; }
.search-dropdown-item small { color: var(--text-light); font-size: 0.8rem; }

/* ---- CONTENT LAYOUT ---- */
.content-layout {
    display: flex;
    gap: 32px;
    margin-top: 8px;
}

/* ---- FILTERS ---- */
.filters {
    width: 240px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    align-self: flex-start;
    position: sticky;
    top: 92px;
}
.filters h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: var(--burgundy);
    margin-bottom: 16px;
}

.filter-group {
    margin-bottom: 16px;
}
.filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6050' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.filter-group select:focus {
    outline: none;
    border-color: var(--amber);
}

.btn-clear {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-light);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-clear:hover {
    border-color: var(--burgundy);
    color: var(--burgundy);
}

/* ---- CHEESE GRID ---- */
.result-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.cheese-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    align-content: start;
}

.cheese-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.cheese-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--amber);
    opacity: 0;
    transition: opacity var(--transition);
}
.cheese-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--amber);
}
.cheese-card:hover::before { opacity: 1; }

.cheese-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--brown);
    margin-bottom: 8px;
}

.cheese-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 50px;
    letter-spacing: 0.03em;
}
.badge-country { background: #F3EAD0; color: var(--brown); }
.badge-region { background: #E8DFC8; color: var(--text-light); }
.badge-pdo { background: var(--burgundy); color: #FDF6E3; }

.cheese-sub {
    font-size: 0.83rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.cheese-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.stars {
    color: var(--amber);
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* ---- CHEESE DETAIL ---- */
.cheese-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.cheese-detail-header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--burgundy);
    line-height: 1.15;
    margin-bottom: 8px;
}

.big-rating {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--amber);
    line-height: 1;
    text-align: center;
}
.big-stars {
    color: var(--amber);
    letter-spacing: 4px;
    font-size: 1.2rem;
    text-align: center;
    margin: 4px 0;
}
.cheese-detail-rating {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.cheese-description {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.cheese-description h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: var(--burgundy);
    margin-bottom: 8px;
}
.cheese-description p { color: var(--text); line-height: 1.7; }

/* ---- PRODUCERS SECTION ---- */
.producers-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.producers-section h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: var(--burgundy);
    margin-bottom: 4px;
}
.producer-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
    font-style: italic;
}
.producers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.producer-card {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.producer-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brown);
    margin-bottom: 2px;
}
.producer-name a {
    color: var(--olive);
    text-decoration: none;
    transition: color var(--transition);
}
.producer-name a:hover { color: var(--olive-light); text-decoration: underline; }
.producer-location {
    font-size: 0.8rem;
    color: var(--text-light);
}
.producer-since {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 2px;
}

/* Rating Breakdown */
.rating-breakdown {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: grid;
    gap: 8px;
}
.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.83rem;
    color: var(--text-light);
}
.rating-bar-row span:first-child { width: 50px; text-align: right; }
.rating-bar-row span:last-child { width: 24px; text-align: left; }
.rating-bar-bg {
    flex: 1;
    height: 10px;
    background: var(--cream);
    border-radius: 5px;
    overflow: hidden;
}
.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--amber-light));
    border-radius: 5px;
    transition: width 0.6s ease;
    min-width: 2px;
}

/* ---- USER ACTIONS ---- */
.user-actions {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.shelf-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.shelf-btn {
    padding: 10px 20px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.shelf-btn:hover { border-color: var(--amber); color: var(--amber); }
.shelf-btn.active[data-status="want_to_try"] { background: #FDF6E3; border-color: var(--amber); color: var(--amber); }
.shelf-btn.active[data-status="tried"] { background: #EEF2E2; border-color: var(--olive); color: var(--olive); }
.shelf-btn.active[data-status="favorite"] { background: #FDF0ED; border-color: var(--burgundy); color: var(--burgundy); }
.shelf-btn.remove { color: #B05A5A; border-color: transparent; }
.shelf-btn.remove:hover { border-color: #C67676; background: #FDF5F5; }

/* ---- STAR RATING INPUT ---- */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
    margin-bottom: 12px;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 1.8rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: var(--amber);
}
.star-rating-input label:hover { transform: scale(1.2); }

/* ---- REVIEW FORM ---- */
.review-form h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    color: var(--burgundy);
    margin-bottom: 12px;
}
.review-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    transition: border-color var(--transition);
    margin-bottom: 12px;
}
.review-form textarea:focus {
    outline: none;
    border-color: var(--amber);
}

.btn-primary {
    padding: 10px 28px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    background: var(--burgundy);
    color: var(--cream);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--burgundy-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(107, 29, 47, 0.3); }

/* ---- REVIEW CARDS ---- */
.reviews-section { margin-top: 8px; }
.reviews-section h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    color: var(--burgundy);
    margin-bottom: 16px;
}

.review-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}
.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.review-header strong { color: var(--brown); }
.review-header a { color: var(--brown); text-decoration: none; }
.review-header a:hover { color: var(--burgundy); }
.review-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.review-date {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: auto;
}
.review-text {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}

/* ---- AUTH PAGES ---- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}
.auth-card h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: var(--burgundy);
    margin-bottom: 24px;
    text-align: center;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}
.form-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.93rem;
    font-family: 'DM Sans', sans-serif;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition);
}
.form-group input:focus {
    outline: none;
    border-color: var(--amber);
}

.auth-alt {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--text-light);
}
.auth-alt a { color: var(--burgundy); font-weight: 500; }

/* ---- OAUTH BUTTONS ---- */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-bg);
    color: var(--text);
}
.oauth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 43, 31, 0.12);
}
.oauth-google:hover { border-color: #4285F4; color: #4285F4; }
.oauth-github:hover { border-color: #24292e; color: #24292e; background: #f6f8fa; }
.oauth-apple:hover { border-color: #000; color: #fff; background: #000; }

.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.oauth-divider span {
    padding: 0 12px;
}

.error-message {
    background: #FDF0ED;
    border: 1px solid #E8C4C0;
    color: #8B3A3A;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
}

/* ---- LOGIN PROMPT ---- */
.login-prompt {
    text-align: center;
    padding: 32px;
    background: var(--card-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 1rem;
    color: var(--text-light);
}
.login-prompt a { color: var(--burgundy); font-weight: 600; }

/* ---- PROFILE ---- */
.profile-header {
    margin-bottom: 32px;
}
.profile-header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    color: var(--burgundy);
}

.profile-content { display: grid; gap: 40px; }

.profile-section h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    color: var(--brown);
    margin-bottom: 16px;
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.shelf-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    position: relative;
}
.shelf-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: var(--amber);
}
.shelf-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    color: var(--brown);
    margin-bottom: 4px;
}

.shelf-status {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.shelf-status-want_to_try { background: #FDF6E3; color: var(--amber); }
.shelf-status-tried { background: #EEF2E2; color: var(--olive); }
.shelf-status-favorite { background: #FDF0ED; color: var(--burgundy); }

/* ---- TOP PAGE ---- */
.top-page h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    color: var(--burgundy);
    margin-bottom: 4px;
}
.top-page > p {
    color: var(--text-light);
    margin-bottom: 24px;
    font-style: italic;
}

.cheese-card-rank {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--amber);
    margin-bottom: 4px;
}

/* ---- FOOTER ---- */
.footer {
    text-align: center;
    padding: 32px 24px;
    background: var(--charcoal);
    color: #8B8070;
    font-size: 0.83rem;
    margin-top: auto;
    border-top: 3px solid var(--amber);
}

/* ---- EMPTY STATE ---- */
.empty {
    color: var(--text-light);
    font-style: italic;
    padding: 24px 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .content-layout { flex-direction: column; }
    .filters {
        width: 100%;
        position: static;
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        padding: 16px;
    }
    .filters h3 { width: 100%; margin-bottom: 0; }
    .filter-group { margin-bottom: 0; }
    .filter-group label { display: none; }
    .filter-group select { width: auto; }
    .btn-clear { align-self: center; }

    .cheese-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .cheese-detail-header { flex-direction: column; }
    .nav-container { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px; }
    .nav-links { gap: 12px; }
}

@media (max-width: 600px) {
    .hero { padding: 32px 16px 24px; }
    .hero h1 { font-size: 1.8rem; }
    .shelf-buttons { gap: 6px; }
    .shelf-btn { padding: 8px 14px; font-size: 0.8rem; }
    .container { padding: 16px; }
    .auth-card { padding: 24px; }
}
