/* ===================================================================
   MANIXZ BAKERY — gaya asas (light editorial)
   Tailwind CDN uruskan utiliti; fail ini untuk apa yang ia tak boleh buat.
   =================================================================== */

html { scroll-behavior: smooth; }
body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; }
h1, h2, h3, .font-display { font-family: 'Playfair Display', Georgia, serif; }
section[id] { scroll-margin-top: 96px; }

:focus-visible { outline: 3px solid #9C4A1E; outline-offset: 2px; }

/* Wajib — kalau tidak atribut [hidden] tidak berkesan bila Tailwind
   menetapkan display pada elemen yang sama. */
[hidden] { display: none !important; }

.img-fallback { background: linear-gradient(135deg, #F1E9DE, #FAF6F0); }

/* --- Marquee --- */
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 26s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- Carousel ---------------------------------------------------- *
   @keyframes, BUKAN transition: slaid pertama dirender terus dengan
   kelas aktif, jadi transition sudah berada di nilai akhir dan langsung
   tidak beranimasi.
   Nisbah bingkai dikunci supaya tiada anjakan susun atur.
 * ----------------------------------------------------------------- */
.carousel {
    position: relative;
    overflow: hidden;
    padding-bottom: 125%;          /* 4:5 mudah alih */
}
@media (min-width: 1024px) {
    .carousel { padding-bottom: 0; height: 100%; min-height: 34rem; }
}
.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
}
.carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
    animation: slide-in 700ms ease-out;
}
.carousel-slide img,
.carousel-slide picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@keyframes slide-in {
    from { opacity: 0; transform: scale(1.04); }
    to   { opacity: 1; transform: scale(1); }
}
.carousel-dot {
    width: .5rem; height: .5rem;
    border-radius: 9999px;
    background: rgba(43,33,26,.22);
    transition: background .2s, width .2s;
}
.carousel-dot.is-active { background: #9C4A1E; width: 1.5rem; }

/* --- Butang bertema ---------------------------------------------- *
   :hover mesti kemas kini pemboleh ubah, BUKAN background/color terus —
   kalau tidak ia mengatasi setiap varian dan teks boleh hilang.
 * ----------------------------------------------------------------- */
.btn {
    --btn-bg: #9C4A1E;
    --btn-fg: #FAF6F0;
    --btn-bd: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 2px solid var(--btn-bd);
    font-weight: 800;
    border-radius: 9999px;
    padding: .875rem 1.75rem;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.btn:hover:not(:disabled) { --btn-bg: #7E3A16; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--ghost { --btn-bg: transparent; --btn-fg: #2B211A; --btn-bd: #E3D8CA; }
.btn--ghost:hover:not(:disabled) { --btn-bg: transparent; --btn-bd: #9C4A1E; }

.btn--dark { --btn-bg: #F1E9DE; --btn-fg: #2B211A; --btn-bd: #E3D8CA; }
.btn--dark:hover:not(:disabled) { --btn-bg: #E3D8CA; --btn-bd: #9C4A1E; }

.btn--danger { --btn-bg: transparent; --btn-fg: #A3323C; --btn-bd: rgba(163,50,60,.4); }
.btn--danger:hover:not(:disabled) { --btn-bg: rgba(163,50,60,.12); --btn-bd: #A3323C; }

.btn--sm { padding: .5rem 1rem; font-size: .8125rem; }

/* --- Pemilih saiz --- */
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option span {
    display: block;
    min-width: 3.25rem;
    text-align: center;
    padding: .625rem .5rem;
    border: 1px solid #E3D8CA;
    border-radius: .875rem;
    font-weight: 700;
    font-size: .875rem;
    transition: border-color .2s, background-color .2s, color .2s;
}
.size-option input:checked + span { border-color: #9C4A1E; background: rgba(156,74,30,.12); color: #9C4A1E; }
.size-option input:focus-visible + span { outline: 3px solid #9C4A1E; outline-offset: 2px; }
.size-option input:disabled + span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* --- Borang --- */
.field {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #E3D8CA;
    border-radius: .875rem;
    padding: .75rem 1rem;
    color: #2B211A;
    font-size: .875rem;
    transition: border-color .2s;
}
.field:focus { border-color: #9C4A1E; outline: none; }
.field::placeholder { color: rgba(107,91,78,.55); }
select.field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B5B4E' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1.1rem;
    padding-right: 2.5rem;
}
.label { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6B5B4E; margin-bottom: .5rem; }
.field-error { border-color: #A3323C; }
.help { font-size: .75rem; color: #6B5B4E; margin-top: .375rem; }
.help--error { color: #A3323C; }

/* --- Pelbagai --- */
.price-strike { text-decoration: line-through; opacity: .5; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .faq-chevron { transform: rotate(180deg); }

.stepper button {
    width: 2.25rem; height: 2.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #E3D8CA; border-radius: .625rem;
    color: #2B211A; cursor: pointer;
    transition: border-color .2s, background-color .2s;
}
.stepper button:hover:not(:disabled) { border-color: #9C4A1E; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }

.badge {
    display: inline-flex; align-items: center; gap: .375rem;
    font-size: .6875rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; padding: .25rem .625rem; border-radius: 9999px;
    border: 1px solid;
}

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: .75rem .875rem; text-align: left; border-bottom: 1px solid #E3D8CA; font-size: .875rem; }
table.data th { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: #6B5B4E; font-weight: 700; }
table.data tbody tr:hover { background: #FAF6F0; }

/* Cetak invois */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .print-plain, .print-plain * { background: #fff !important; color: #000 !important; border-color: #ccc !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .marquee-track { animation: none; }
}

/* --- Pil "Cuba Admin Panel" (demo sahaja) ---------------------------- *
   Duduk di kiri bawah supaya tidak berlanggar dengan butang WhatsApp di
   kanan. Pada skrin kecil ia mengecil jadi ikon sahaja.
 * --------------------------------------------------------------------- */
.admin-fab { backdrop-filter: blur(6px); }
.admin-fab:hover { transform: translateY(-1px); }

@media (max-width: 640px) {
    .admin-fab { padding-right: .625rem; gap: 0; }
    .admin-fab > span:last-child { display: none; }
}

/* ===================================================================
   EDITORIAL LAYER — Manixz Bakery
   Nada: light, photo-forward, serif display. Rujukan gaya: bakeri
   artisan kejiranan. Semua nilai di sini SENGAJA tiada dalam Tailwind
   supaya identiti kedai tak nampak macam template.
   =================================================================== */

/* --- Skala taip --------------------------------------------------- */
body { font-size: 16px; line-height: 1.6; color: #2B211A; }
h1, h2, h3, .font-display {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.015em;
}
.font-display.font-bold,
.font-display.font-extrabold,
.font-display.font-semibold { font-weight: 600; }

/* Label kecil huruf besar — tanda gaya editorial */
.eyebrow {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .22em;
}

/* Kepala seksyen: tajuk kiri, pautan kanan, garis nipis bawah */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E3D8CA;
}

/* Pautan teks dengan anak panah yang bergerak bila hover */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #9C4A1E;
    cursor: pointer;
    transition: color .2s;
}
.link-arrow::after {
    content: '';
    width: 1.75rem; height: 1px;
    background: currentColor;
    transition: width .25s ease;
}
.link-arrow:hover { color: #7E3A16; }
.link-arrow:hover::after { width: 2.75rem; }

/* Garis pemisah pendek dalam blok cerita */
.rule { width: 3.5rem; height: 2px; background: #9C4A1E; }

/* Nombor langkah bulat */
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; height: 2.75rem;
    border: 1px solid #9C4A1E;
    border-radius: 9999px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    color: #9C4A1E;
}

/* --- Hero penuh gambar -------------------------------------------- */
.carousel-slide--hero { position: absolute; inset: 0; }
.carousel-slide--hero img,
.carousel-slide--hero picture { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Scrim: cukup gelap untuk teks putih lulus 4.5:1, tapi gambar masih nampak */
.hero-scrim {
    background:
        linear-gradient(90deg, rgba(24,16,11,.72) 0%, rgba(24,16,11,.42) 45%, rgba(24,16,11,.06) 100%),
        linear-gradient(0deg,  rgba(24,16,11,.30) 0%, rgba(24,16,11,0) 42%);
}
@media (max-width: 640px) {
    .hero-scrim { background: linear-gradient(0deg, rgba(28,20,15,.85) 10%, rgba(28,20,15,.45) 70%, rgba(28,20,15,.30) 100%); }
}

/* Butang di atas gambar — garis putih, latar telus */
.btn--onphoto { --btn-bg: transparent; --btn-fg: #FFFFFF; --btn-bd: rgba(255,255,255,.65); }
.btn--onphoto:hover:not(:disabled) { --btn-bg: rgba(255,255,255,.14); --btn-bd: #FFFFFF; }

.carousel-dot--onphoto { background: rgba(255,255,255,.45); }
.carousel-dot--onphoto.is-active { background: #FFFFFF; }

/* --- Kad produk gaya editorial ------------------------------------ */
/* Sudut hampir tajam, bukan bulat — lebih dekat kepada majalah makanan */
.card-media { border-radius: 2px; }

/* Had panjang baris supaya perenggan mudah dibaca */
.prose-narrow p { max-width: 68ch; }
