/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #1f2937;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a:hover {
    color: #3498db !important;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== HEADER - Merah Gradient (Existing) ===== */
.hdr {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(90deg, #dc0000, #ff1744);
    box-shadow: 0 6px 18px rgba(220, 0, 0, 0.35);
}

.hdr .wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    white-space: nowrap;
}

.search {
    flex: 1;
    display: flex;
    gap: 8px;
}

.search input {
    flex: 1;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
}

.search button {
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #dc0000;
    font-weight: 700;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 0, 0, 0.25);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== HAMBURGER MENU (NEW - RESPONSIVE) ===== */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger.active {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== HERO ===== */
.hero {
    background: #fff;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: block;
}

.hero-left h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #dc0000;
}

.hero-left p {
    margin: 0 0 12px 0;
    color: #6b7280;
}

.btn-hero {
    display: inline-block;
    background: linear-gradient(180deg, #dc0000, #b00020);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(220, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 0, 0, 0.35);
    background: linear-gradient(180deg, #b00020, #8b0000);
}

.hero-right img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 14px;
}

/* ===== CATEGORIES ===== */
.catbar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 16px;
    -webkit-overflow-scrolling: touch;
}

.chip {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 999px;
    padding: 8px 12px;
    color: #dc0000;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background: #fce4ec;
    border-color: #dc0000;
}

/* ===== GRID LAYOUT ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 576px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== CARD ===== */
.card {
    background: #fff;
    border: 1px solid #f0f0f3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(220, 0, 0, 0.12);
}

.thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #fafafa;
    display: block;
}

.badge {
    display: inline-block;
    background: #ffe0e0;
    color: #b00020;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
}

.card-body {
    padding: 10px 12px;
}

.title {
    font-size: 14px;
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    margin: 4px 0;
}

.price {
    color: #dc0000;
    font-weight: 800;
}

.price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 12px;
    margin-left: 6px;
}

.rating {
    float: right;
    color: #f59e0b;
    font-weight: 700;
}

.sold {
    color: #6b7280;
    font-size: 12px;
}

.btn-buy {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #dc0000, #b00020);
    color: #fff;
    font-weight: 800;
    padding: 10px;
    margin-top: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(220, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.btn-buy:hover {
    background: linear-gradient(180deg, #b00020, #8b0000);
    transform: translateY(-2px);
}

/* ===== SIDEBAR (NEW - RESPONSIVE) ===== */
.sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 60px;
    width: 100%;
    max-width: 300px;
    height: calc(100vh - 60px);
    background: #2c2c2c;
    color: #fff;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar.active {
    display: block;
}

.sidebar::after {
    content: '';
    position: fixed;
    right: 0;
    top: 60px;
    width: calc(100vw - 300px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    display: none;
}

.sidebar.active::after {
    display: block;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 12px 20px;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #dc0000;
    color: #fff;
    border-left: 4px solid #fff;
    padding-left: 16px;
}

.sidebar-menu-icon {
    font-size: 18px;
    width: 24px;
    flex-shrink: 0;
}

/* ===== FOOTER ===== */
.ftr {
    margin-top: 24px;
    background: #fff;
    border-top: 1px solid #eee;
    color: #6b7280;
}

.ftr-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    justify-content: space-between;
}

/* ===== BOTTOM BAR (Mobile Navigation) ===== */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 6px 8px;
    z-index: 45;
}

.bb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    padding: 6px;
}

.bb-item:hover {
    color: #dc0000;
}

.bb-item.active {
    color: #dc0000;
    font-weight: 800;
}

@media (min-width: 992px) {
    .bottom-bar {
        display: none;
    }
}

/* ===== MODERN ADMIN ENHANCEMENTS ===== */
.btn-hero, a[href*="/admin"], button[class*="btn"] {
    transition: all 0.2s ease;
}

table tr {
    transition: background 0.2s ease;
}

table th {
    font-weight: 600;
    color: #2c3e50;
    border-top: none;
}

table td {
    vertical-align: middle;
}

input[type="search"],
input[type="text"],
input[type="number"],
textarea,
select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
}

input[type="search"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #dc0000;
    box-shadow: 0 0 0 3px rgba(220, 0, 0, 0.1);
}

/* ===== THEME CUSTOM STYLES ===== */
:root {
    --primary: #3498db;
    --secondary: #6c757d;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
}

/* ===== CUSTOM BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* ===== CARDS STYLES ===== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ===== FORM CONTROLS ===== */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
}

/* ===== MODAL CUSTOM ===== */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: none;
    padding: 20px 25px;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ===== SCROLLBAR CUSTOM ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #dc0000;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b00020;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 992px) {
    .hdr .wrap {
        padding: 10px 12px;
        gap: 10px;
    }

    .brand {
        font-size: 16px;
    }

    .search {
        flex: 1;
    }

    .search input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .search button {
        padding: 8px 12px;
    }

    .nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    .hdr .wrap {
        padding: 10px;
        gap: 8px;
    }

    .brand {
        font-size: 14px;
    }

    .search {
        flex: 0.8;
    }

    .search input {
        padding: 8px 10px;
        font-size: 12px;
    }

    .search button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .hero-inner {
        padding: 12px;
    }

    .hero-left h1 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .hero-left p {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .btn-hero {
        padding: 8px 12px;
        font-size: 12px;
    }

    .catbar {
        padding: 6px 12px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card {
        border-radius: 10px;
    }

    .thumb {
        height: 140px;
    }

    .card-body {
        padding: 8px 10px;
    }

    .title {
        font-size: 13px;
        height: 32px;
    }

    .price {
        font-size: 14px;
    }

    .btn-buy {
        padding: 8px;
        font-size: 12px;
        margin-top: 6px;
    }

    .ftr-inner {
        padding: 12px;
        flex-direction: column;
        gap: 12px;
    }

    .bottom-bar {
        padding: 4px 6px;
    }

    .bb-item {
        font-size: 11px;
        gap: 1px;
    }

    input[type="search"],
    input[type="text"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px;
        padding: 10px 12px;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    .hdr .wrap {
        padding: 8px;
        gap: 6px;
    }

    .brand {
        font-size: 12px;
    }

    .search {
        display: none;
    }

    .hamburger {
        font-size: 20px;
        padding: 4px 8px;
    }

    .hero-inner {
        padding: 10px;
    }

    .hero-left h1 {
        font-size: 16px;
    }

    .hero-left p {
        font-size: 12px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .thumb {
        height: 120px;
    }

    .card-body {
        padding: 6px 8px;
    }

    .title {
        font-size: 12px;
        height: 30px;
    }

    .price {
        font-size: 13px;
    }

    .btn-buy {
        padding: 6px;
        font-size: 11px;
    }

    .catbar {
        padding: 4px 8px;
        gap: 6px;
    }

    .chip {
        padding: 6px 10px;
        font-size: 11px;
    }

    .ftr-inner {
        padding: 10px;
    }

    .bottom-bar {
        padding: 3px 4px;
        bottom: 0;
    }

    .bb-item {
        font-size: 10px;
        padding: 3px 2px;
    }
}
