/**
 * TOKO WAWAN - Custom Styles
 * Click and Collect
 */

/* =============================================
   CSS Variables / Root
   ============================================= */
:root {
    --primary-color: #1a365d;
    --primary-dark: #0f2942;
    --primary-light: #2c5282;
    --secondary-color: #3182ce;
    --accent-color: #ecc94b;
    --accent-dark: #d69e2e;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #dd6b20;
    --info-color: #3182ce;
    --light-color: #f7fafc;
    --dark-color: #1a202c;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --border-radius: 8px;
    --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 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* =============================================
   Global Styles
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--dark-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
   Navbar Styles
   ============================================= */
.navbar-custom {
    background-color: var(--primary-color) !important;
    padding: 0.75rem 1rem;
    box-shadow: var(--box-shadow);
}

.navbar-custom .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .navbar-brand i {
    color: var(--accent-color);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

.navbar-custom .search-box {
    position: relative;
    max-width: 300px;
}

.navbar-custom .search-box input {
    padding-left: 2.5rem;
    border-radius: 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
}

.navbar-custom .search-box input:focus {
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.3);
}

.navbar-custom .search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.navbar-custom .search-box .btn-search {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon {
    position: relative;
    color: #fff !important;
}

.cart-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: var(--dark-color);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
}

/* =============================================
   Admin Navbar
   ============================================= */
.admin-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.admin-navbar .nav-link {
    margin: 0 0.25rem;
}

.admin-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* =============================================
   Hero / Banner Section
   ============================================= */
.promo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    color: #fff;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.promo-banner .banner-content {
    text-align: center;
    z-index: 1;
}

.promo-banner h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* =============================================
   Category Section
   ============================================= */
.category-section {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.category-section h5 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.category-item {
    text-align: center;
    padding: 1rem 0.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.category-item:hover {
    border-color: var(--secondary-color);
    background-color: var(--gray-100);
}

.category-item.active {
    border-color: var(--secondary-color);
    background-color: rgba(49, 130, 206, 0.1);
}

.category-item .cat-code {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.category-item .cat-name {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* =============================================
   Product Cards
   ============================================= */
.product-section h5 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

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

.product-card .product-image {
    width: 100%;
    height: 150px;
    background-color: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-image .placeholder-img {
    width: 60px;
    height: 60px;
    background-color: var(--gray-400);
    border-radius: var(--border-radius);
}

.product-card .product-info {
    padding: 1rem;
}

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

.product-card .product-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.product-card .btn-buy {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.product-card .btn-buy:hover {
    background-color: var(--primary-color);
}

/* =============================================
   Product Detail Page
   ============================================= */
.breadcrumb-custom {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--secondary-color);
}

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

.product-detail-image {
    width: 100%;
    height: 300px;
    background-color: var(--gray-200);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.product-detail-info .product-code {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.product-detail-info .product-price-detail {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.product-detail-info .product-stock {
    color: var(--success-color);
    font-weight: 500;
}

.product-detail-info .product-stock.low {
    color: var(--danger-color);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control .btn-qty {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quantity-control .btn-qty:hover {
    background-color: var(--gray-200);
}

.quantity-control input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

.btn-add-cart {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-buy-now {
    background-color: #fff;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-buy-now:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

/* =============================================
   Cart Page
   ============================================= */
.cart-section {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.cart-section h4 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background-color: var(--gray-200);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.cart-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.cart-table .qty-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cart-table .qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.cart-table .qty-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--gray-300);
}

.cart-summary {
    text-align: right;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-200);
}

.cart-summary .summary-row {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    margin-bottom: 0.5rem;
}

.cart-summary .summary-label {
    font-weight: 600;
    color: var(--gray-600);
}

.cart-summary .summary-value {
    font-weight: 700;
    color: var(--dark-color);
    min-width: 120px;
}

.cart-summary .total-row {
    font-size: 1.1rem;
}

.cart-summary .total-row .summary-value {
    color: var(--secondary-color);
}

/* =============================================
   Checkout Form
   ============================================= */
.checkout-form {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.checkout-form h5 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.checkout-form .form-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.checkout-form .form-control,
.checkout-form .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-300);
    padding: 0.625rem 0.875rem;
}

.checkout-form .form-control:focus,
.checkout-form .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.btn-checkout {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-continue {
    background-color: #fff;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-continue:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* =============================================
   Admin Dashboard
   ============================================= */
.admin-container {
    padding: 2rem 0;
}

.stat-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

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

.stat-card .stat-title {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

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

.stat-card .stat-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.stat-card .btn-view {
    margin-top: 1rem;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 0.375rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.stat-card .btn-view:hover {
    background-color: var(--primary-color);
}

.admin-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.admin-card h5 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card h5 i {
    color: var(--secondary-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: var(--gray-100);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

.admin-table tr:hover {
    background-color: var(--gray-50);
}

/* Status Badges */
.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-process,
.badge-proses {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-ready,
.badge-siap {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-done,
.badge-selesai {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-cancel,
.badge-batal {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-low {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-ok {
    background-color: #d1fae5;
    color: #065f46;
}

/* =============================================
   Footer
   ============================================= */
.footer-custom {
    background-color: var(--gray-700);
    color: #fff;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-custom .footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-custom .footer-links a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    transition: var(--transition);
}

.footer-custom .footer-links a:hover {
    color: #fff;
}

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

.text-secondary-custom {
    color: var(--secondary-color) !important;
}

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

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

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

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

/* =============================================
   Responsive Adjustments
   ============================================= */
@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navbar-custom .search-box {
        max-width: 100%;
        margin: 0.5rem 0;
    }
}

@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .cart-table {
        font-size: 0.85rem;
    }
    
    .footer-custom .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .promo-banner {
        min-height: 120px;
        padding: 1rem;
    }
    
    .product-detail-card {
        padding: 1rem;
    }
    
    .checkout-form {
        padding: 1rem;
    }
}

/* =============================================
   Animation Classes
   ============================================= */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .navbar-custom,
    .footer-custom,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .admin-card,
    .cart-section,
    .checkout-form {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
