/* Gluten Free Shopping — base stylesheet */

:root {
    --green: #28a745;
    --orange: #ffc107;
    --red: #dc3545;
    --bg: #f8f9fa;
    --text: #333;
    --border: #dee2e6;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    padding-top: 40px; /* space for Google Translate bar */
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.site-header .logo {
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--green);
}

.site-nav a {
    margin-left: 1rem;
    text-decoration: none;
    color: #0066cc;
}

.site-nav a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Flash messages */
.flash {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid var(--border);
    transition: border-color 0.2s;
}

.product-card.border-green  { border-color: var(--green); }
.product-card.border-orange { border-color: var(--orange); }
.product-card.border-red    { border-color: var(--red); }

.product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.product-card .card-body {
    padding: 0.5rem;
}

.product-card .card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
}

.product-card .card-shop {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.product-card .card-badge {
    font-size: 0.75rem;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.badge-certified { background: #007bff; color: #fff; }
.badge-ok         { background: #d4edda; color: #155724; }
.badge-warning    { background: #fff3cd; color: #856404; }

/* Forms */
form { max-width: 600px; }

label {
    display: block;
    font-weight: 600;
    margin: 1rem 0 0.25rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

button, .btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 1rem;
}

button:hover, .btn:hover {
    background: #218838;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filters select {
    width: auto;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

/* Product detail page */
.product-detail {
    max-width: 800px;
    margin: 0 auto;
}

.product-detail-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-image {
    flex: 1;
    min-width: 250px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid var(--border);
}

.detail-image.border-green  { border-color: var(--green); }
.detail-image.border-orange { border-color: var(--orange); }
.detail-image.border-red    { border-color: var(--red); }

.detail-image img {
    width: 100%;
    display: block;
    cursor: zoom-in;
}

/* Image zoom overlay */
.zoom-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
    padding: 1rem;
}

.zoom-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.detail-meta p {
    margin: 0.25rem 0;
}

.label-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: #856404;
}

.feedback-summary,
.also-in {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.feedback-summary h3,
.also-in h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.red-cross-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.freshness-green  { color: var(--green); font-weight: 600; }
.freshness-orange { color: #b8860b; font-weight: 600; }
.freshness-red    { color: var(--red); font-weight: 600; }

.country-selector {
    max-width: 400px;
    margin: 0 auto 2rem;
    text-align: center;
}

.country-selector select {
    height: auto;
}

/* Profile page */
.profile-info {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.profile-info p {
    margin: 0.25rem 0;
}

h2 {
    margin-top: 2rem;
    font-size: 1.2rem;
}

/* Upload page */
.upload-guidance {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.upload-guidance p {
    margin: 0.25rem 0;
}

.image-preview {
    margin-bottom: 0.5rem;
}

.image-preview img {
    display: block;
}

.upload-confirm {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: #856404;
}

input[type="file"] {
    padding: 0.3rem;
}

/* Admin page */
.admin-product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
}

.admin-product-images {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-thumb {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.admin-form label {
    margin: 0.5rem 0 0.15rem;
    font-size: 0.85rem;
}

.admin-form input,
.admin-form select {
    padding: 0.3rem;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.admin-actions {
    margin-top: 0.75rem;
}

.admin-reject {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.admin-reject select {
    flex: 1;
}

.admin-pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.admin-report {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
    .admin-product-card {
        grid-template-columns: 1fr;
    }
}

.rotate-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rotate-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #f8f9fa;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.rotate-btn:hover {
    background: #e9ecef;
}

/* Voting */
.voting-actions {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.voting-actions h3 {
    width: 100%;
    margin-top: 0;
    font-size: 1.1rem;
}

.vote-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
    display: inline-block;
}

.vote-btn:hover {
    background: #e9ecef;
}

.vote-active {
    background: #d4edda;
    border-color: var(--green);
    color: #155724;
}

.vote-danger {
    border-color: var(--red);
    color: var(--red);
}

.vote-done {
    background: #e9ecef;
    color: #666;
    cursor: default;
}

.vote-note {
    width: 100%;
    font-size: 0.82rem;
    color: #666;
    margin: 0.25rem 0 0 0;
    font-style: italic;
}

.vote-prompt {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.vote-prompt a {
    font-weight: 600;
}
