:root {
    --coffee-dark: #1a120b;
    --coffee-darker: #120c07;
    --coffee-card: #241a12;
    --coffee-border: #3a2b1e;
    --cream: #f3e6d3;
    --muted: #b8a48c;
    --gold: #c9974a;
    --gold-light: #e3b56d;
    --danger: #e5484d;
    --success: #4ade80;
    --radius: 14px;
    --font: "Vazirmatn", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--coffee-dark);
    background-image: radial-gradient(circle at 20% 0%, #2a1c10 0%, var(--coffee-dark) 45%);
    color: var(--cream);
    line-height: 1.8;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Scroll reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1.is-visible { transition-delay: .05s; }
.reveal-delay-2.is-visible { transition-delay: .15s; }
.reveal-delay-3.is-visible { transition-delay: .25s; }
.reveal-delay-4.is-visible { transition-delay: .35s; }

/* ---- Public header/footer ---- */
.site-header {
    background: rgba(18, 12, 7, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--coffee-border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
}
.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand:hover { text-decoration: none; color: var(--gold); }
.brand-flame { filter: drop-shadow(0 0 6px rgba(201,151,74,.6)); }
.site-header nav a {
    margin-inline-start: 28px;
    color: var(--cream);
    font-weight: 600;
}
.site-header nav a:hover { color: var(--gold-light); }

.page { padding-bottom: 90px; }

.site-footer {
    text-align: center;
    padding: 26px;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--coffee-border);
}

/* ---- Banner ---- */
.banner {
    position: relative;
    width: 100%;
    max-height: 460px;
    overflow: hidden;
    margin-bottom: 50px;
}
.banner img {
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
    filter: brightness(0.55);
}
.banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.banner-overlay h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--gold-light);
    margin: 0 0 8px;
    text-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.banner-overlay p { font-size: 1.2rem; color: var(--cream); margin: 0; }

/* ---- Hero fallback ---- */
.hero { text-align: center; margin: 50px 0 40px; }
.hero h1 { font-size: 2.4rem; color: var(--gold-light); margin-bottom: 6px; }
.hero p { color: var(--muted); font-size: 1.1rem; }

.section-title {
    font-size: 1.5rem;
    color: var(--gold-light);
    border-inline-start: 4px solid var(--gold);
    padding-inline-start: 12px;
    margin: 40px 0 20px;
}

/* ---- Product grids ---- */
.featured-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--coffee-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--coffee-border);
    color: var(--cream);
    display: block;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.45);
    border-color: var(--gold);
    text-decoration: none;
}
.product-image { aspect-ratio: 16/9; overflow: hidden; background: #2a1c10; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.product-card:hover .product-image img { transform: scale(1.06); }
.placeholder-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); background: #2a1c10;
}
.placeholder-image.large { aspect-ratio: 16/9; border-radius: var(--radius); }
.product-info { padding: 18px; }
.product-info h3 { margin: 6px 0; font-size: 1.2rem; color: var(--cream); }
.product-info p { color: var(--muted); margin: 4px 0; font-size: 0.95rem; }
.price { font-weight: 700; color: var(--gold-light); }
.price.large { font-size: 1.5rem; }

.badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #241505;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ---- Product details + slider ---- */
.product-details {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 44px;
    margin-top: 40px;
}

.slider {
    direction: ltr; /* internal mechanics stay predictable regardless of page RTL */
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #2a1c10;
    border: 1px solid var(--coffee-border);
}
.slider-track {
    display: flex;
    transition: transform .4s ease;
}
.slide {
    min-width: 100%;
    aspect-ratio: 16/9;
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18,12,7,0.65);
    color: var(--gold-light);
    border: 1px solid var(--coffee-border);
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.slider-arrow:hover { background: var(--gold); color: #241505; }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }

.slider-dots {
    position: absolute;
    bottom: 14px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(243,230,211,0.4);
    cursor: pointer;
    padding: 0;
}
.dot.active { background: var(--gold-light); }

.details-info h1 { margin-top: 0; color: var(--gold-light); }
.short-desc { color: var(--muted); font-size: 1.05rem; }
.full-desc { margin-top: 16px; }
.back-link { display: inline-block; margin-top: 26px; font-weight: 600; }

@media (max-width: 800px) {
    .product-details { grid-template-columns: 1fr; }
    .banner-overlay h1 { font-size: 2rem; }
}

/* ---- Contact page ---- */
.contact-page { padding-top: 50px; }
.contact-page h1 { color: var(--gold-light); margin-bottom: 20px; }
.contact-details p { margin: 8px 0; }
.map-embed { margin-top: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--coffee-border); }

/* ---- Forms (shared, also used by admin) ---- */
.admin-form, .login-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
}
.admin-form label, .login-box label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}
.admin-form label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
input, textarea, select {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--coffee-border);
    border-radius: 6px;
    background: #180f08;
    color: var(--cream);
}
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

.btn, button.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #241505;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-start;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }

.link-btn {
    background: none; border: none; padding: 0; color: var(--gold-light);
    cursor: pointer; font: inherit; text-decoration: underline;
}
.link-btn.danger { color: var(--danger); }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 8px; }
.alert-success { background: #16341f; color: var(--success); }
.alert-error { background: #3a1416; color: var(--danger); }
.alert-error:empty { display: none; }

/* ---- Admin shell (kept LTR/neutral for clarity as a back-office tool) ---- */
.admin-body { background: #0f0b08; direction: ltr; text-align: left; font-family: "Segoe UI", system-ui, sans-serif; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: #120c07;
    color: var(--cream);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--coffee-border);
}
.admin-brand { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; color: var(--gold-light); }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-sidebar nav a {
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 6px;
}
.admin-sidebar nav a:hover { background: var(--coffee-card); text-decoration: none; color: var(--cream); }
.logout-form button {
    width: 100%; background: var(--coffee-card); color: var(--cream); border: 1px solid var(--coffee-border);
    padding: 10px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.admin-content { padding: 32px 40px; background: var(--coffee-dark); color: var(--cream); }
.admin-content.full {
    display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
}

.login-box {
    background: var(--coffee-card);
    padding: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--coffee-border);
    width: 100%;
    max-width: 380px;
}
.login-box h1 { color: var(--gold-light); }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.stat-cards { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--coffee-card);
    border: 1px solid var(--coffee-border);
    border-radius: var(--radius);
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
}
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--gold-light); }
.stat-label { color: var(--muted); font-size: 0.9rem; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--coffee-card); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--coffee-border); text-align: left; }
.admin-table th { background: #1c130c; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }
.thumb-sm { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.row-actions { display: flex; gap: 12px; align-items: center; }

.image-manager { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.image-manager-item {
    background: var(--coffee-card);
    border: 1px solid var(--coffee-border);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 140px;
}
.image-manager-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; }
