/* Pesteh Bakery — public site styles. Mobile-first, hand-built, no framework. */

:root {
    --color-primary: #5e624f;
    --color-primary-dark: #454832;
    --color-accent: #b5652b;
    --color-bg: #faf6ef;
    --color-surface: #ffffff;
    --color-text: #2a2a26;
    --color-muted: #6b6a5e;
    --color-border: #e6e0d2;
    --radius: 10px;
    --wrap-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.6em;
    color: var(--color-text);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
p { margin: 0 0 1em; }
a { color: var(--color-primary); }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap-width); margin: 0 auto; padding: 0 1.25rem; }

.site-flash { padding: 0.75rem 1rem; border-radius: 8px; margin: 1.25rem 0 0; font-size: 0.9rem; }
.site-flash-error { background: #fbeae8; color: #a83b2f; border: 1px solid #f0c9c4; }
.site-flash-success { background: #eaf3ec; color: #3f7a4d; border: 1px solid #c9e0cd; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--color-primary); color: #fff;
    padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.btn-primary {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary:hover { background: #954f20; }
.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    text-decoration: none;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Header                                                                  */
/* ---------------------------------------------------------------------- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header-inner {
    max-width: var(--wrap-width);
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    margin-right: auto;
}
.site-logo img {
    height: 34px;
    width: auto;
}
@media (min-width: 860px) {
    .site-logo img { height: 42px; }
}
.primary-nav { display: none; }
.primary-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.primary-nav a { text-decoration: none; color: var(--color-text); font-weight: 500; }
.primary-nav a:hover { color: var(--color-primary); }

.basket-link {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.basket-count {
    background: var(--color-accent);
    color: #fff;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.75rem;
}

.nav-toggle {
    width: 40px; height: 40px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    background: none; border: none; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-text); display: block; }

.mobile-nav { border-top: 1px solid var(--color-border); padding: 1rem 1.25rem 1.5rem; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { border-bottom: 1px solid var(--color-border); }
.mobile-nav a { display: block; padding: 0.85rem 0.2rem; text-decoration: none; color: var(--color-text); font-size: 1.05rem; }
.mobile-nav-heading { color: var(--color-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 1.25rem 0 0.25rem; }

@media (min-width: 860px) {
    .primary-nav { display: block; }
    .nav-toggle, .mobile-nav { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Page header + content blocks                                           */
/* ---------------------------------------------------------------------- */
.page-header { padding: 2.5rem 0 1rem; }
.page-content { padding-bottom: 3rem; }
.page-content > section { margin: 2rem 0; }

.block-hero {
    background: linear-gradient(180deg, #f2ede0, var(--color-bg));
    padding: 4rem 0;
    text-align: center;
}
.block-hero-sub { font-size: 1.15rem; color: var(--color-muted); max-width: 34rem; margin: 0 auto 1.5rem; }

.block-text { max-width: 42rem; }
.block-text h2 { margin-top: 2rem; }

.block-image { margin: 2rem 0; }
.block-image figcaption { color: var(--color-muted); font-size: 0.85rem; margin-top: 0.5rem; }

.block-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.block-gallery-grid img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; }
@media (min-width: 700px) {
    .block-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.block-cta {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: 3rem 0;
    border-radius: var(--radius);
}
.block-cta h2, .block-cta p { color: #fff; }
.block-cta .btn-primary { margin-top: 0.5rem; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer {
    background: var(--color-primary-dark);
    color: #ece9dd;
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
}
.site-footer-inner {
    max-width: var(--wrap-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: 0.75rem; }
.site-footer a { color: #ece9dd; }
.hours-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.hours-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.newsletter-form { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.newsletter-form input { flex: 1; padding: 0.5rem; border-radius: 6px; border: none; min-width: 0; }
.newsletter-form button { border: none; border-radius: 6px; background: var(--color-accent); color: #fff; padding: 0.5rem 0.9rem; cursor: pointer; }
.social-links { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.85rem; }
.footer-copyright { text-align: center; color: #b8b5a4; font-size: 0.8rem; margin: 2rem 0 0; }

@media (min-width: 700px) {
    .site-footer-inner { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------------------------------------------------------------- */
/* Menu + products                                                         */
/* ---------------------------------------------------------------------- */
.menu-layout { display: block; padding-bottom: 3rem; }
.menu-filters { margin-bottom: 2rem; }
.menu-filters fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0 0 1rem; }
.menu-filters legend { font-weight: 600; padding: 0 0.4rem; font-family: var(--font-heading); }
.menu-filters label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; margin-bottom: 0.4rem; }
.menu-filters label.checkbox { justify-content: flex-start; }
.menu-filters input[type="number"] { width: 100%; padding: 0.4rem; border: 1px solid var(--color-border); border-radius: 6px; }
.clear-filters { display: inline-block; margin-left: 0.75rem; color: var(--color-muted); font-size: 0.85rem; }

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.product-card { display: block; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.15s ease; }
.product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
.product-card img, .product-card-placeholder { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee6d6; }
.product-card-body { padding: 0.9rem; }
.product-card-body h3 { font-size: 1.05rem; margin: 0.2rem 0; }
.product-price { color: var(--color-accent); font-weight: 600; margin: 0; }
.product-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.badge-pill { color: #fff; font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 999px; font-weight: 600; }

@media (min-width: 620px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .menu-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start; }
    .menu-filters { margin-bottom: 0; position: sticky; top: 5.5rem; }
}

.product-detail { padding: 2.5rem 0 4rem; display: block; }
.product-detail-main-image { width: 100%; border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; }
.product-detail-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.product-detail-thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }
.product-detail-info { margin-top: 1.5rem; }
.product-tags { color: var(--color-muted); font-size: 0.85rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.product-tags a { color: inherit; text-decoration: none; }
.product-tags a:hover { text-decoration: underline; }
.add-to-cart-form { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-top: 1.5rem; }
.add-to-cart-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--color-muted); }
.add-to-cart-form select, .add-to-cart-form input { padding: 0.55rem; border-radius: 6px; border: 1px solid var(--color-border); font: inherit; }

@media (min-width: 800px) {
    .product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* ---------------------------------------------------------------------- */
/* Cart + checkout                                                         */
/* ---------------------------------------------------------------------- */
.cart-page { padding-bottom: 4rem; }
.cart-table { display: flex; flex-direction: column; gap: 0.75rem; }
.cart-row { display: grid; grid-template-columns: 56px 1fr auto auto auto; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--color-border); }
.cart-row-image { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.cart-row-info { display: flex; flex-direction: column; }
.cart-row-info a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.cart-qty-input { width: 3.5rem; padding: 0.35rem; border: 1px solid var(--color-border); border-radius: 6px; }
.cart-line-total { font-weight: 600; }
.cart-summary { margin-top: 2rem; display: flex; align-items: center; gap: 1.5rem; }
.cart-subtotal { font-size: 1.1rem; }

.checkout-layout { display: block; padding-bottom: 4rem; gap: 2.5rem; }
.checkout-form { display: flex; flex-direction: column; gap: 1rem; max-width: 34rem; }
.checkout-form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; color: var(--color-muted); }
.checkout-form input, .checkout-form select, .checkout-form textarea { padding: 0.6rem; border: 1px solid var(--color-border); border-radius: 6px; font: inherit; }
.checkout-form fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.checkout-form legend { font-weight: 600; font-family: var(--font-heading); padding: 0 0.4rem; }
.checkout-summary { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; margin-top: 2rem; }
.checkout-summary-row { display: flex; justify-content: space-between; padding: 0.3rem 0; }
.field-error { color: #a83b2f; font-size: 0.8rem; font-weight: 600; }

.order-confirmation { padding: 3rem 0; text-align: center; }
.order-confirmation .tracking-link { display: inline-block; margin-top: 1rem; word-break: break-all; }

.badge { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #eee; }
.badge-new { background: #fde8d6; color: #8a4a12; }
.badge-confirmed { background: #dbe9de; color: #2f5f3b; }
.badge-completed { background: #dde3f0; color: #33447a; }
.badge-cancelled { background: #f2dcda; color: #8a2f27; }

.message-thread { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.message-bubble { padding: 0.8rem 1rem; border-radius: 10px; max-width: 85%; background: var(--color-surface); border: 1px solid var(--color-border); }
.message-bubble p { margin: 0 0 0.3rem; }
.message-owner { align-self: flex-start; }
.message-customer { align-self: flex-end; background: #f2ede0; }
.message-meta { font-size: 0.75rem; color: var(--color-muted); font-weight: 600; }
.message-attachment { display: inline-block; margin-top: 0.4rem; font-size: 0.85rem; }

/* ---------------------------------------------------------------------- */
/* Gallery                                                                  */
/* ---------------------------------------------------------------------- */
.gallery-page { padding-bottom: 4rem; }
.gallery-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.gallery-filters a { padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--color-border); text-decoration: none; color: var(--color-text); font-size: 0.85rem; }
.gallery-filters a.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.gallery-grid { columns: 2 220px; column-gap: 0.9rem; }
.gallery-tile { margin: 0 0 0.9rem; break-inside: avoid; }
.gallery-tile img { border-radius: var(--radius); width: 100%; }
.gallery-tile figcaption { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.3rem; }
@media (min-width: 700px) { .gallery-grid { columns: 3 220px; } }

/* ---------------------------------------------------------------------- */
/* Blog                                                                     */
/* ---------------------------------------------------------------------- */
.blog-page { padding-bottom: 4rem; }
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.blog-card { display: block; text-decoration: none; color: inherit; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.blog-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.blog-card-body { padding: 1rem; }
.blog-card-body h2 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.blog-meta { color: var(--color-muted); font-size: 0.8rem; }
.blog-meta a { color: inherit; text-decoration: none; }
.blog-meta a:hover { text-decoration: underline; }
.blog-post-body { max-width: 42rem; line-height: 1.75; }
.blog-post-body img { border-radius: var(--radius); margin: 1.5rem 0; }
@media (min-width: 700px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------------- */
/* Error pages                                                             */
/* ---------------------------------------------------------------------- */
.error-page { padding: 5rem 0; text-align: center; }
