/* =========================
   1. PENGATURAN DASAR
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f7fb;
    color: #333;
    line-height: 1.6;
}

/* =========================
   2. HEADER
========================= */

header {
    background-color: #ffffff;
    padding: 15px 3%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

header img {
    width: 100px;
    align-items: left;
}

/* =========================
   3. NAVIGASI
========================= */

nav {
    display: flex;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: 0.3s;
}

nav a:hover {
    color: #000000;
}

/* =========================
   4. AREA KONTEN
========================= */

main {
    width: 85%;
    max-width: 1100px;
    margin: 40px auto;
}

/* =========================
   5. HERO SECTION
========================= */

.hero {
    background: linear-gradient(135deg, #000000, #000000);
    color: white;
    padding: 60px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.tagline {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero p:last-child {
    max-width: 800px;
}



/* =========================
   7. FORM PENCARIAN
========================= */

form {
    margin-top: 15px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

input[type="text"] {
    width: 75%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #000000;
}

/* =========================
   8. TOMBOL
========================= */

button,
.button-katalog,
.btn-pengembalian,
.tombol-pengembalian {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;

    min-height: 46px;
    padding: 12px 22px;

    border: 2px solid #000000;
    border-radius: 10px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;

    text-align: center;
    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Tombol biru */
button,
.button-katalog {
    background-color: #000000;
    color: #ffffff;
}

/* Tombol outline */
.btn-pengembalian,
.tombol-pengembalian {
    background-color: #ffffff;
    color: #000000;
}

/* Hover tombol biru */
button:hover,
.button-katalog:hover {
    background-color: #000000;
    border-color: #000000;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

/* Hover tombol outline */
.btn-pengembalian:hover,
.tombol-pengembalian:hover {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

/* Fokus keyboard */
button:focus-visible,
.button-katalog:focus-visible,
.btn-pengembalian:focus-visible,
.tombol-pengembalian:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

button {
    margin-left: 8px;
}

/* Ukuran tombol aksi */
button:has(+ .btn-pengembalian),
button:has(+ .tombol-pengembalian),
.button-katalog:has(+ .btn-pengembalian),
.button-katalog:has(+ .tombol-pengembalian),
.btn-pengembalian,
.tombol-pengembalian {
    min-width: 210px;
}

/* Jarak antartombol */
button + .btn-pengembalian,
button + .tombol-pengembalian,
.button-katalog + .btn-pengembalian,
.button-katalog + .tombol-pengembalian {
    margin-left: 8px;
}

/* =========================
   9. SECTION KATEGORI
========================= */

.kategori-section {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto 25px;
}

/* Judul dan disusun vertikal */
.kategori-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.kategori-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}


/* =========================
   10. LAYOUT KARTU KATEGORI
========================= */

.kategori-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

/* Kartu dibagi rata mengikuti jumlah kategori */
.kategori-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 185px;
    padding: 24px 16px;

    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);

    text-align: center;
    text-decoration: none;
    transition: 0.25s ease;
}

.kategori-card:hover {
    transform: translateY(-5px);
    border-color: #333;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

/* Ikon berada di tengah */
.kategori-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 55px;
    margin-bottom: 10px;
    color: #172554;
    font-size: 42px;
    line-height: 1;
}

/* Nama kategori */
.kategori-card h3 {
    margin: 8px 0 6px;
    color: #111827;
    font-size: 16px;
}

/* Jumlah barang */
.kategori-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

/* =========================
   11. FOOTER
========================= */

footer {
    background-color: #333;
    color: #d1d5db;
    text-align: center;
    padding: 25px;
    margin-top: 50px;
}

footer p {
    margin: 5px 0;
}

/* =========================
   12. TAMPILAN TABLET
========================= */

@media screen and (max-width: 992px) {
    .kategori-container {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* =========================
   13. TAMPILAN HP
========================= */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 40px 25px;
    }

    .hero h1 {
        font-size: 30px;
    }

    input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }

    button,
    .button-katalog,
    .btn-pengembalian,
    .tombol-pengembalian {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    button + .btn-pengembalian,
    button + .tombol-pengembalian,
    .button-katalog + .btn-pengembembalian,
    .button-katalog + .tombol-pengembalian {
        margin-top: 12px;
        margin-left: 0;
    }

    main {
        width: 92%;
    }
}

@media screen and (max-width: 600px) {
    .kategori-section {
        margin-top: 30px;
    }

    .kategori-header h2 {
        font-size: 20px;
    }

    .kategori-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .kategori-card {
        min-height: 165px;
        padding: 20px 12px;
    }

    .kategori-icon {
        font-size: 36px;
    }

    .kategori-card h3 {
        font-size: 14px;
    }
}

/* HP dengan layar sangat kecil */
@media screen and (max-width: 360px) {
    .kategori-container {
        grid-template-columns: 1fr;
    }
}

/* =========================
   SECTION ARTIKEL
========================= */

.artikel-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 25px;
}

.artikel-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.artikel-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.artikel-header .lihat-semua {
    align-self: flex-end;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

/* =========================
   LAYOUT KARTU ARTIKEL
========================= */

.artikel-section .kategori-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.artikel-section .kategori-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;

    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);

    text-align: center;
    text-decoration: none;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.artikel-section .kategori-card:hover {
    transform: translateY(-5px);
    border-color: #000000;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.artikel-section .kategori-card:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

/* =========================
   GAMBAR ARTIKEL
========================= */

.artikel-section .artikel-gambar {
    display: block;
    width: 100%;
    height: 160px;
    flex-shrink: 0;

    object-fit: cover;
    object-position: center;
}

/* =========================
   TEKS ARTIKEL
========================= */

.artikel-konten {
    flex: 1;
    padding: 18px 16px 22px;
}

.artikel-section .kategori-card h3 {
    margin: 0 0 10px;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

.artikel-section .kategori-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

/* Tablet: dua kartu per baris */
@media (max-width: 992px) {
    .artikel-section .kategori-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* HP: satu kartu per baris */
@media (max-width: 480px) {
    .artikel-section {
        padding: 20px;
    }

    .artikel-section .kategori-container {
        grid-template-columns: 1fr;
    }

    .artikel-section .artikel-gambar {
        height: 190px;
    }
}