/* ======================
   GLOBAL
===================== */

/* Body untuk semua halaman */
body {
    background-color: #f9f9f9;       
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: #333;                     
    padding-top: 70px;              
    margin: 0;                       
}

/* Link (a) */
a {
    color: #007bff;                  
    text-decoration: none;           
}
a:hover {
    color: #0056b3;                  
    text-decoration: underline;      
}

/* ======================
   NAVBAR
====================== */
.navbar {
    background: #222;

}

.navbar a {
    color: #f5f5f5;
    margin: 0 10px;
    text-decoration: none;
    font-weight: 500;
}
.navbar a:hover {
    color: #ff7f50;
}

/* ======================
   LAYOUT
===================== */

/* Container utama konten */
.main-content {
    margin-top: 30px;                
}

/* ======================
   SIDEBAR (Kategori & Filter)
===================== */

/* Sidebar wrapper */
.sidebar {
    background: #fff;                 
    padding: 15px;                    
    border: 1px solid #ddd;           
    border-radius: 6px;               
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 20px;              
}

/* Tombol untuk show/hide sidebar */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;                  
    font-weight: bold;
    margin-bottom: 10px;
}
.sidebar-toggle i {
    transition: transform 0.3s ease;  
}
.sidebar-toggle.collapsed i {
    transform: rotate(-90deg);        
}

/* Isi sidebar (kategori/brand) */
.sidebar-content {
    display: none;                    
}
.sidebar-content.active {
    display: block;                   
}

/* ======================
   PRODUCT CARD
===================== */

/* Container produk */
.card {
    border: none;          /* hilangkan border */
    border-radius: 0;      /* kotak tanpa rounded */
    overflow: hidden;
    margin-bottom: 20px;              
    background: none;       /* hilangkan background */
    box-shadow: none;       /* hilangkan shadow */
    text-align: center;     
}

/* Gambar produk */
.card-img-top {
    width: 50%;
    height: auto;           /* tinggi mengikuti proporsi gambar */
    object-fit: cover;      /* foto full tanpa terpotong */
    margin-bottom: 8px;     
}

/* Card body untuk teks */
.card-body {
    padding: 4px 0;         
    text-align: center;     
}

/* Judul produk */
.card-title {
    display: inline-block;   
    padding: 4px 8px;        /* kotak mengikuti panjang teks */
    border-radius: 4px;      
    background-color: #f8f9fa;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

/* Hover effect untuk judul */
.card-title:hover {
    background-color: #007bff;
    color: #fff;
}
.stock-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #dc3545; /* merah */
    color: #fff;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(220,53,69,0.7); /* shadow merah */
    z-index: 10;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Harga produk */
.card-text {
    display: inline-block;
    padding: 2px 6px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    color: #28a745;
    font-weight: bold;
}

/* Tombol lihat detail */
.btn-primary {
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
}
/* ======================
   SEARCH & FILTER
===================== */

/* Kotak search */
.search-box {
    margin-bottom: 20px;              
}
.search-box input {
    border-radius: 20px;              
    padding: 8px 15px;                
    border: 1px solid #ccc;           
    width: 100%;                      
}
.search-box button {
    border-radius: 20px;              
    padding: 8px 20px;                
    background: #007bff;              
    border: none;                     
    color: #fff;                      
}
.search-box button:hover {
    background: #0056b3;              
}

/* ======================
   PAGINATION
===================== */

/* Container pagination */
.pagination {
    margin: 20px 0;                   
    justify-content: center;          
}
.pagination li a {
    color: #007bff;                   
    border-radius: 4px;               
    margin: 0 2px;                    
}
.pagination li.active a {
    background-color: #007bff;        
    color: #fff;                      
}

/* ======================
   LOGIN INFO / WARNING
===================== */

/* Box warning login */
.login-warning {
    background: #fff3cd;              
    color: #856404;                   
    border: 1px solid #ffeeba;        
    padding: 15px;                    
    border-radius: 6px;               
    margin-bottom: 20px;              
    font-size: 16px;                  
    font-weight: 500;
}

/* ======================
   FOOTER
===================== */

footer {
    background: #222;                 
    color: #fff;                      
    padding: 20px 0;                  
    text-align: center;               
    margin-top: 40px;                 
}

/* ======================
   GLOBAL REPEAT
===================== */
.container {
    margin-top: 20px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
}

/* ======================
   SEARCH BAR
===================== */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-bar input {
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #ddd;
    width: 100%;
}

.search-bar button {
    border-radius: 6px;
}

.sidebar h4 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: #007bff;
}

/* ======================
   FILTER CATEGORY
====================== */
.brand-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px auto;
    max-width: 1000px;
}

.brand-filter a {
    padding: 8px 14px;
    border-radius: 20px;
    background: #eee;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.brand-filter a.active,
.brand-filter a:hover {
    background: #007bff;
    color: #fff;
}

/* ======================
   PRODUK CARD
====================== */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card img {
    max-width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 8px;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    margin-top: 5px;
}


/* ======================
   SIDEBAR KATEGORI TOGGLE
===================== */
#kategoriBox {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    max-height: 400px;        
    overflow-y: auto;         
    transition: all 0.3s ease;
}

#kategoriBox::-webkit-scrollbar {
    width: 6px;
}
#kategoriBox::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

#kategoriBox a {
    display: block;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #eee;
}

#kategoriBox a:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateX(4px);
}

/* Tombol toggle kategori */
.btn-outline-secondary {
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* === Gambar produk === */
.highlight-products img {
    display: block;
    margin: auto;
    max-height: 180px;     /* batas tinggi gambar */
    width: auto;
    object-fit: contain;   /* gambar tidak ketarik */
}

/* Style nama merk di highlight */
.highlight-name {
    display: inline-block;
    background: rgba(0,0,0,0.6); /* abu gelap transparan */
    color: #fff;                 /* teks putih */
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    margin-top: 8px;
}


/* Pastikan link tidak override warna */
.highlight-card a {
    text-decoration: none;
    color: inherit; /* ikut .highlight-name */
}


/* --- Responsive --- */

/* HP kecil (≤480px) */
@media (max-width: 480px) {
    .highlight-card {
        max-width: 140px;
    }
    .highlight-products img {
        max-height: 120px;
    }
    .highlight-name {
        font-size: 0.8rem;
    }
}

/* HP sedang (≤720px) */
@media (max-width: 720px) {
    .highlight-card {
        max-width: 170px;
    }
    .highlight-products img {
        max-height: 140px;
    }
    .highlight-name {
        font-size: 0.9rem;
    }
}

/* Tablet & HP besar (≤1080px) */
@media (max-width: 1080px) {
    .highlight-card {
        max-width: 200px;
    }
    .highlight-products img {
        max-height: 160px;
    }
    .highlight-name {
        font-size: 1rem;
    }
}

/* Desktop (≥1081px) */
@media (min-width: 1081px) {
    .highlight-card {
        max-width: 250px;
    }
    .highlight-products img {
        max-height: 180px;
    }
    .highlight-name {
        font-size: 1.1rem;
    }
}



/* Gambar Produk */
.highlight-img {
    width: 100%;
    max-width: 180px;   /* biar di desktop nggak terlalu besar */
    height: auto;
    object-fit: contain;
    border: 2px solid #FF4500;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

.highlight-img:hover {
    transform: scale(1.75);
    box-shadow: 0 0 20px #FF4500, 0 0 40px #FF6347;
}

/* Border Kedip / Laser Effect */
@keyframes borderBlink {
    0% { border-color: #FF4500; box-shadow: 0 0 5px #FF4500; }
    50% { border-color: #FF6347; box-shadow: 0 0 20px #FF6347; }
    100% { border-color: #FF4500; box-shadow: 0 0 5px #FF4500; }
}

/* ======================
   ADJUST PRODUCT CARD TO REMOVE BACKGROUND & AUTO-SIZE
===================== */
.card {
    background: none; /* hapus background putih */
    border: none;     /* hapus border */
    box-shadow: none; /* hapus shadow */
}

.card-title, .card-text {
    display: inline-block;
    background: #f8f8f8;  /* kotak teks sesuai panjang kalimat */
    padding: 3px 6px;
    border-radius: 5px;
    margin-bottom: 5px;
}

/* ======================
   CLEAN-UP GLOBAL DUPLICATES
===================== */
body, .container, .navbar, .sidebar, .pagination, .login-warning {
    box-sizing: border-box;
}
/* ======================
   PRODUCT NAME & PRICE BOX
===================== */
.nama-produk {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;       /* tinggi minimal 2 spasi */
    padding: 4px 10px;
    background: linear-gradient(45deg, #ff7f50, #ff6347);
    border-radius: 6px;
    font-weight: bold;
    color: #fff;
    width: 100%;
    text-align: center;
    line-height: 1.2;
    overflow-wrap: break-word; /* wrap teks panjang */
}

.nama-produk span {
    display: inline-block;
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;    /* untuk kata panjang */
}

.nama-produk:hover {
    transform: scale(1.03);
}

.harga-box {
    display: inline-block;
    background: linear-gradient(45deg, #1e90ff, #00bfff);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
}
.harga-box:hover {
    transform: scale(1.03);
}
.nama-merk {
    display: inline-block;
    background: linear-gradient(45deg, #ffa500, #ff8c00);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
}
.nama-merk:hover {
    transform: scale(1.03);
}
.slide-image {
    width: 100%;
    height: auto;       /* ganti dari 300px jadi auto */
    object-fit: cover;
}

/* Carousel container */
.carousel-inner {
    display: flex;
    align-items: center;     /* vertikal center */
    justify-content: center; /* horizontal center */
    overflow: hidden;
    height: auto; /* 50% tinggi viewport, bisa diubah sesuai kebutuhan */
}

/* Gambar slide */
.carousel-inner img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

/* Caption */
.carousel-caption {
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1rem;
}

/* ======================
   FILTER MERK BUTTONS
===================== */
.merk-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}

.merk-filter a {
    display: inline-block;
    padding: 6px 12px;  
    border-radius: 16px; 
    font-size: 13px;     
    font-weight: 500;
    text-decoration: none;
    color: #fff;           /* teks putih */
    border: 1px solid #ff8c00;  /* border orange */
    background: #ff8c00;        /* background orange */
    transition: all 0.3s ease;
}

.merk-filter a:hover {
    background: #ff7f50;   /* hover lebih terang */
    color: #fff;
    border-color: #ff7f50;
    transform: translateY(-2px);
}

.merk-filter a.active {
    background: #ff4500;   /* tombol aktif lebih gelap */
    color: #fff;
    border-color: #ff4500;
}
.btn-detail {
    display: inline-block;
    background-color: #28a745;  /* hijau */
    color: #fff;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #28a745;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-detail:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}
/* Kotak logo */
.brand-logo-box {
    display: inline-block;
    padding: 15px;
    background: #000;
    border-radius: 12px;
    animation: rainbowGlow 3s linear infinite;
}

.brand-logo {
    max-height: 70px;
    display: block;
}

/* Animasi border pelangi */
@keyframes rainbowGlow {
    0% { box-shadow: 0 0 8px 2px red; }
    20% { box-shadow: 0 0 8px 2px orange; }
    40% { box-shadow: 0 0 8px 2px yellow; }
    60% { box-shadow: 0 0 8px 2px green; }
    80% { box-shadow: 0 0 8px 2px blue; }
    100% { box-shadow: 0 0 8px 2px violet; }
}

/* Card container */
.highlight-products .highlight-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

/* biar enak di mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important; /* pastiin ga ada kotak putih */
    border-radius: 0;   /* hapus radius kartu */
    box-shadow: none;   /* hapus bayangan */
    padding: 0;
}

.highlight-products .highlight-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.highlight-products .highlight-img {
    width: 100%;
    max-width: 240px;
    height: auto;
    object-fit: contain;
    border: 3px solid #FF4500;
    border-radius: 12px;
    background: transparent !important;
    display: block;
}

/* Nama produk */
.highlight-products .product-name {
    margin-top: 8px;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
}

/* ======================
   RESPONSIVE
====================== */

/* Desktop besar (≥1080px) */
@media screen and (min-width: 1080px) {
    .highlight-products .highlight-img {
        max-width: 260px;
    }
    .highlight-products .product-name {
        font-size: 1.2rem;
    }
}

/* Tablet / layar sedang (≤1080px) */
@media screen and (max-width: 1080px) {
    .highlight-products .highlight-img {
        max-width: 220px;
    }
}

/* HP besar (≤720px) */
@media screen and (max-width: 720px) {
    .highlight-products {
        margin: 20px 0;
    }
    .highlight-products .highlight-img {
        max-width: 160px;
    }
    .highlight-products .product-name {
        font-size: 0.9rem;
    }
}

/* HP kecil (≤480px) */
@media screen and (max-width: 480px) {
    .highlight-products {
        margin: 15px 0;
    }
    .highlight-products .highlight-img {
        max-width: 120px;
        border: 2px solid #FF4500; /* border tipis biar ga makan ruang */
    }
    .highlight-products .product-name {
        font-size: 0.8rem;
    }
}

/* ======================
   HIGHLIGHT PRODUCTS FIX
====================== */
.highlight-products {
    text-align: center;
    margin: 30px auto;
}

.highlight-products .carousel-inner {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 18px; /* jarak antar kartu */
}

.highlight-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    max-width: 220px;
    flex: 1 1 auto;
    background: transparent !important;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Gambar produk */
.highlight-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border: 2px solid #FF4500;
    border-radius: 12px;
    background: transparent !important;
}

/* Nama produk */
.highlight-name {
    margin-top: 8px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    min-height: 2.4em;   /* supaya rata meskipun teks beda panjang */
    line-height: 1.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Kotak peringatan tidak bisa dikirim */
.text-danger strong {
    display: block;
    background-color: #001f4d; /* biru tua */
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    margin: 15px 0;
    font-size: 15px;
}

/* List produk */
.list-produk {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Kotak produk */
.produk-item {
    border: 2px solid #8B0000; /* merah cabe tua */
    border-radius: 6px;
    padding: 8px 12px;
    background-color: #fff;
    display: flex;
    align-items: center;
    font-size: 14px;
}

/* Nomor urut */
.produk-item .nomor {
    font-weight: bold;
    margin-right: 8px;
}

/* Nama produk */
.produk-item .nama {
    flex: 1;
}

/* Jumlah */
.produk-item .jumlah {
    color: #333;
    font-style: italic;
}
/* =========================
   Backend General Styles
========================= */
/* Products (for included products.php) */
.products-content {
    margin: 0;
    padding: 0; /* jangan tambahkan padding di wrapper ini */
}

/* berikan sedikit padding internal agar teks tidak nempel ke tepi layar */
.products-content .full-width-header {
    padding: 12px 15px 6px 15px;
}

/* pastikan tabel mengisi area yang disediakan oleh container-fluid (index.php) */
.products-table {
    width: 100%;
    margin: 0;
}

/* gambar thumb rapi dan tidak menambah margin */
.product-thumb {
    display: block;
    width: 120px;     /* sesuaikan ukuran thumbnail */
    height: auto;
    object-fit: cover;
    margin: 8px 0;
}

/* hilangkan margin/padding berlebih di elemen form/header */
.products-content .filter-search-row,
.products-content .filter-search-row .row {
    margin: 0;
    padding: 0;
}

/* mobile tweaks */
@media (max-width: 768px) {
    .product-thumb { width: 60px; }
    .products-content .full-width-header { padding-left: 12px; padding-right: 12px; }
}
/* Bungkus utama */
.register-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh; /* biar di tengah vertical */
  background: #f4f6f9;
}

/* Card Form */
.register-box {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 450px;
}

/* Judul */
.register-box h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

/* Input */
.register-box input,
.register-box select,
.register-box textarea {
  margin-bottom: 12px;
  border-radius: 6px;
}

/* Tombol */
.btn-register {
  width: 100%;
  background: #0d6efd;
  color: white;
  font-weight: bold;
  padding: 10px;
  border-radius: 6px;
}

/* Info login */
.login-info {
  margin-top: 15px;
  background: #d4edda;
  color: #155724;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
}
