@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:wght@600&display=swap');

:root {
    --bg-main: #fdfcfb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-accent: #334155;
    --color-accent: #D1C4E9;
    --color-accent-dark: #9c84c1;
    --color-surface: #f8fafc;
    --color-border: #f1f5f9;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

/* REVISI 1: Menambahkan smooth scrolling untuk anchor links */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    overflow-x: hidden; /* Mencegah layar bergeser ke samping */
}

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

a {
    text-decoration: none;
    color: inherit;
    /* REVISI 2: Menambahkan transisi default untuk semua link */
    transition: all 0.2s ease; 
}

ul {
    list-style: none;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

header h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    letter-spacing: 0.25em;
    color: #0f172a;
    font-weight: 600;
}

header p {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

/* Hero Section (Carousel) */
.hero-carousel {
    padding: 0 1rem 2rem 1rem;
    position: relative;
}

.carousel-viewport {
    overflow: hidden; /* Menyembunyikan gambar di luar kotak */
    border-radius: 1rem;
    background-color: var(--color-surface);
}

.carousel-track {
    display: flex;
    /* Efek geser (slide) yang mulus selama 0.5 detik */
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-track img {
    flex: 0 0 100%; /* Memaksa setiap gambar selebar layar wadah */
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.hero-carousel nav {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

.hero-carousel nav button {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background-color: #cbd5e1;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-carousel nav button[aria-current="true"] {
    background-color: var(--color-accent-dark);
    transform: scale(1.3); /* Membesar sedikit saat aktif */
}

/* REVISI 3: Efek hover pada navigasi banner */
main > section:first-of-type nav button:hover {
    background-color: var(--color-accent-dark);
    opacity: 0.7;
}

/* Kategori Section */
section[aria-labelledby="kategori-heading"] {
    margin-bottom: 2.5rem;
}

h2 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 1rem;
    margin-bottom: 1rem;
    color: var(--text-accent);
}

section[aria-labelledby="kategori-heading"] ul {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0 1rem;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

section[aria-labelledby="kategori-heading"] ul::-webkit-scrollbar {
    display: none;
}

section[aria-labelledby="kategori-heading"] li {
    flex: 0 0 4.5rem;
    scroll-snap-align: start;
}

section[aria-labelledby="kategori-heading"] a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

section[aria-labelledby="kategori-heading"] a img {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #f8f4f1;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.25rem;
    object-fit: contain;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* REVISI 4: Efek hover pada kategori */
section[aria-labelledby="kategori-heading"] a:hover img {
    transform: translateY(-2px);
    border-color: var(--color-accent-dark);
}

section[aria-labelledby="kategori-heading"] a span {
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
}

/* Produk Section */
section[aria-labelledby="produk-heading"] {
    padding: 0 1rem 4rem 1rem;
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Card Produk */
.product-grid article {
    border-radius: 1.2rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f6f3fb 100%);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
    position: relative;
}

/* Hover biar terasa interaktif */
.product-grid article:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.10);
}

/* Image (kalau ada img di dalam article) */
.product-grid article img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Info */
.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Judul produk */
.product-info h3 {
    font-size: 16px; /* sebelumnya 14px */
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d2a32;
}

/* Deskripsi produk */
.product-info p {
    font-size: 13px; /* sebelumnya 12px */
    line-height: 1.5;
    color: #6e6a78;
    margin-bottom: 12px;
}


/* Harga */
.product-price {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

/* Harga coret */
.product-price s {
    font-size: 11px;
    color: #a59db7;
    margin-bottom: 2px;
}

/* Harga utama */
.price-final {
    font-size: 16px;
    font-weight: 700;
    color: #5b4bc4;
}

/* Badge diskon (opsional kalau kamu pakai span) */
.product-price span {
    display: inline-block;
    background: #ff6b6b;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 4px;
    width: fit-content;
}

/* Tombol detail */
.product-info a {
    text-decoration: none;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
    border: 1px solid #d6d1e6;
    color: #5b4bc4;
    transition: all 0.2s ease;
}

/* Hover tombol */
.product-info a:hover {
    background: #5b4bc4;
    color: #fff;
}

/* Tambahan: efek klik */
.product-grid article:active {
    transform: scale(0.98);
}

/* Mempercantik Tombol Lihat Detail */
.product-info a {
    text-align: center;
    background-color: transparent;
    border: 1px solid #5b4bc4;
    color: #5b4bc4;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-info a:active {
    background-color: #5b4bc4;
    color: #ffffff;
}

/* REVISI 5: Efek hover pada kartu produk */
.product-grid article:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.product-grid article img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background-color: var(--color-surface);
}

.product-grid article h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.product-grid article p {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin: 0 0.75rem 1rem 0.75rem;
    line-height: 1.4;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* tambahkan ini */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-grid article a {
    display: block;
    text-align: center;
    background-color: var(--color-accent);
    color: #312e81;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.6rem;
    margin: 0 0.75rem 0.75rem 0.75rem;
    border-radius: 0.5rem;
}

/* REVISI 6: Membedakan efek hover dan active pada tombol produk */
.product-grid article a:hover {
    background-color: var(--color-accent-dark);
    color: #ffffff;
}

.product-grid article a:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Footer */
footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 1rem 3rem 1rem;
    text-align: center;
}

footer p {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

footer ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

footer a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

footer a:active {
    transform: scale(0.95);
}

/* FAB */
aside {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
}

aside a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--color-accent-dark);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(156, 132, 193, 0.4);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

aside a:hover {
    background-color: #8a71b2;
    transform: translateY(-2px);
}

aside a:active {
    transform: scale(0.95);
}

aside a img {
    width: 1.75rem;
    height: 1.75rem;
    filter: brightness(0) invert(1);
}

/* REVISI 7: Perbaikan tata letak FAB di layar besar */
@media (min-width: 481px) {
    aside {
        /* Mengunci FAB ke tengah, lalu menggesernya sejajar dengan batas kanan container 480px */
        left: 50%;
        margin-left: 170px; /* (480/2) - lebar tombol & margin */
        right: auto;
    }
}
