/* ========== INI ADALAH CSS KHUSUS UNTUK HALAMAN KATALOG ========== */
/* Beberapa style diambil dari style.css sebelumnya, tapi ditambah untuk halaman catalog */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== NAVBAR (sama persis dengan index) ========== */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #e67e22;
}

.logo i {
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #e67e22;
}

.nav-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.cart-icon, .login-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #e67e22;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* ========== HERO KATALOG (kecil dan sederhana) ========== */
.catalog-hero {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.catalog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.catalog-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ========== BAGIAN SEARCH & FILTER ========== */
.catalog-controls {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid #eee;
}

.controls-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    flex: 2;
    min-width: 200px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #e67e22;
}

.filter-box {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.filter-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.filter-box select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-box select:focus {
    outline: none;
    border-color: #e67e22;
}

.result-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ========== GRID PRODUK ========== */
.catalog-products {
    padding: 3rem 0;
    min-height: 60vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Kartu produk (sama seperti di index, tapi sedikit disesuaikan) */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 3px solid #e67e22;
}

.product-info {
    padding: 1.2rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-price {
    color: #e67e22;
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0.5rem 0;
}

.product-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background: #e67e22;
}

/* Pesan ketika tidak ada hasil */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
}

.no-results i {
    font-size: 4rem;
    color: #e67e22;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ========== FOOTER ========== */
.footer {
    background-color: #1a252f;
    color: #ecf0f1;
    padding: 3rem 0 0 0;
    margin-top: 2rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: #e67e22;
}

.social-icons a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #e67e22;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #2c3e50;
}

/* ========== MODAL (pop-up) ========== */
.cart-modal, .login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.cart-modal-content, .login-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cart-modal-header, .login-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

.cart-close, .login-close {
    font-size: 2rem;
    cursor: pointer;
}

.cart-modal-body, .login-modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-actions button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.cart-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
}

.btn-checkout {
    background: #27ae60;
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-primary {
    background-color: #e67e22;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
}

/* ========== RESPONSIF (untuk HP) ========== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box, .filter-box {
        width: 100%;
    }
    
    .result-info {
        text-align: center;
    }
    
    .catalog-hero h1 {
        font-size: 1.8rem;
    }
}

/* ========== USER DROPDOWN MENU ========== */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border-radius: 50px;
    transition: all 0.3s;
}

.user-avatar:hover {
    background: #e67e22;
    color: white;
}

.user-avatar i:first-child {
    font-size: 1.2rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar .fa-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.user-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
    text-align: center;
}

.dropdown-header strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dropdown-header small {
    font-size: 0.7rem;
    opacity: 0.9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
    color: #7f8c8d;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #e67e22;
}

.dropdown-item:hover i {
    color: #e67e22;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.3rem 0;
}

.logout-item {
    color: #e74c3c;
}

.logout-item i {
    color: #e74c3c;
}

.logout-item:hover {
    background: #fee;
    color: #e74c3c;
}

/* Responsif untuk dropdown */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-avatar {
        padding: 0.3rem 0.6rem;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .dropdown-menu.show {
        transform: translateY(0);
    }
}