/* ===================================================================
   RUSUH Streetwear — gaya asas
   Tailwind CDN uruskan utiliti; fail ini untuk apa yang ia tak boleh buat.
   =================================================================== */

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

:focus-visible { outline: 3px solid #D7FF3F; 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, #212121, #0D0D0D); }

/* --- 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(255,255,255,.35);
    transition: background .2s, width .2s;
}
.carousel-dot.is-active { background: #D7FF3F; 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: #D7FF3F;
    --btn-fg: #0D0D0D;
    --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: #A9CC1F; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--ghost { --btn-bg: transparent; --btn-fg: #FFFFFF; --btn-bd: #2E2E2E; }
.btn--ghost:hover:not(:disabled) { --btn-bg: transparent; --btn-bd: #D7FF3F; }

.btn--dark { --btn-bg: #212121; --btn-fg: #FFFFFF; --btn-bd: #2E2E2E; }
.btn--dark:hover:not(:disabled) { --btn-bg: #2E2E2E; --btn-bd: #D7FF3F; }

.btn--danger { --btn-bg: transparent; --btn-fg: #FF3B30; --btn-bd: rgba(255,59,48,.4); }
.btn--danger:hover:not(:disabled) { --btn-bg: rgba(255,59,48,.12); --btn-bd: #FF3B30; }

.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 #2E2E2E;
    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: #D7FF3F; background: rgba(215,255,63,.12); color: #D7FF3F; }
.size-option input:focus-visible + span { outline: 3px solid #D7FF3F; outline-offset: 2px; }
.size-option input:disabled + span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* --- Borang --- */
.field {
    width: 100%;
    background: #0D0D0D;
    border: 1px solid #2E2E2E;
    border-radius: .875rem;
    padding: .75rem 1rem;
    color: #fff;
    font-size: .875rem;
    transition: border-color .2s;
}
.field:focus { border-color: #D7FF3F; outline: none; }
.field::placeholder { color: rgba(184,184,184,.55); }
select.field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23B8B8B8' 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: #B8B8B8; margin-bottom: .5rem; }
.field-error { border-color: #FF3B30; }
.help { font-size: .75rem; color: #B8B8B8; margin-top: .375rem; }
.help--error { color: #FF3B30; }

/* --- 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 #2E2E2E; border-radius: .625rem;
    color: #fff; cursor: pointer;
    transition: border-color .2s, background-color .2s;
}
.stepper button:hover:not(:disabled) { border-color: #D7FF3F; }
.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 #2E2E2E; font-size: .875rem; }
table.data th { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: #B8B8B8; font-weight: 700; }
table.data tbody tr:hover { background: rgba(255,255,255,.02); }

/* 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; }
}
