/* ========================================
   GLOBAL STYLES
======================================== */
:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #25D366;
    --danger-color: #dc3545;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --text-color: #374151;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Container */
.container {
    max-width: 1200px;
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
.header {
    background-color: #fff;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--secondary-color) !important;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #20bd5f;
    border-color: #20bd5f;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ========================================
   HERO SECTION
======================================== */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 5rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-section .btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* ========================================
   PRODUCT CARDS
======================================== */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}

.product-card-img {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background-color: var(--light-color);
    overflow: hidden;
}

.product-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-card-img img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.product-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-price-original {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-category,
.product-location {
    font-size: 0.85rem;
    line-height: 1.4;
}

.product-category i,
.product-location i {
    color: var(--primary-color);
}

.product-stock {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.product-stock i {
    color: var(--success-color);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.9rem;
}

/* ========================================
   FILTER & SEARCH
======================================== */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.filter-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.filter-section .form-select,
.filter-section .form-control {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 0.6rem 1rem;
}

.filter-section .form-select:focus,
.filter-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* ========================================
   CATEGORY CARDS
======================================== */
.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    height: 180px;
    min-height: 180px;
    max-height: 180px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
    color: var(--primary-color);
}

.category-card i {
    font-size: 2.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.category-card h5 {
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.category-card p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========================================
   DETAIL PRODUK
======================================== */
.product-gallery {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.product-gallery img {
    width: 100%;
    display: block;
}

.product-detail-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.product-detail-card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.product-detail-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-detail-description {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    margin-top: auto;
    background-color: var(--dark-color) !important;
}

.footer a.hover-primary:hover {
    color: var(--secondary-color) !important;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: var(--success-color);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: var(--box-shadow-lg);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #20bd5f;
    color: #fff;
    transform: scale(1.1);
}

/* ========================================
   ADMIN STYLES
======================================== */
.admin-sidebar {
    background-color: var(--dark-color);
    min-height: 100vh;
    padding: 2rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 8px;
    margin: 0.25rem 1rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
}

.admin-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.admin-card:hover {
    box-shadow: var(--box-shadow-lg);
}

.stat-card {
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   FORMS
======================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 0.6rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ========================================
   TABLES
======================================== */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 991px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    .product-card-title {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .product-actions .btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
}

/* ========================================
   UTILITIES
======================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

.shadow-custom {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg-custom {
    box-shadow: var(--box-shadow-lg) !important;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
