/**
 * customer.css - Desain Antarmuka Customer Portal PT. PNL
 * Gaya E-Commerce Ritel Segar & Grosir (Inspirasi: KlikIndogrosir)
 * Pure Light Mode (Tanpa Dark Mode untuk Customer)
 */

:root {
    --pnl-primary: #007dd3;
    --pnl-primary-rgb: 0, 125, 211;
    --pnl-primary-dark: #0063ab;
    --pnl-primary-hover: #006cb8;
    --pnl-primary-light: #38bdf8;
    --pnl-primary-subtle: #e0f2fe;
    --pnl-primary-text: #004e87;
    --pnl-secondary: #16a34a;
    --pnl-secondary-dark: #15803d;
    --pnl-secondary-subtle: #dcfce7;
    --pnl-secondary-text: #14532d;
    --pnl-accent-orange: #ea580c;
    --pnl-accent-orange-subtle: #ffedd5;
    --pnl-body-bg: #f8fafc;
    --pnl-card-bg: #ffffff;
    --pnl-border: #e2e8f0;
    --pnl-text-main: #0f172a;
    --pnl-text-muted: #64748b;
    --pnl-card-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    --pnl-card-shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    
    /* Bootstrap 5 Theme Variable Overrides */
    --bs-primary: #007dd3;
    --bs-primary-rgb: 0, 125, 211;
    --bs-link-color: #007dd3;
    --bs-link-hover-color: #0063ab;
}

body {
    background-color: var(--pnl-body-bg);
    color: var(--pnl-text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- Top Announcement Bar --- */
.top-bar-announcement {
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--pnl-border);
    font-size: 0.8125rem;
    color: var(--pnl-text-muted);
}

.top-bar-announcement a {
    color: var(--pnl-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.top-bar-announcement a:hover {
    color: var(--pnl-primary);
}

/* --- Sticky Main Header --- */
.customer-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid var(--pnl-border);
    transition: all 0.2s ease;
}

.customer-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--pnl-primary);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.customer-brand-img {
    height: 44px;
    width: auto;
    max-width: 54px;
    object-fit: contain;
    border-radius: 6px;
}

.customer-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--pnl-primary), var(--pnl-primary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 125, 211, 0.25);
}

/* Search Bar Lebar ala KlikIndogrosir */
.search-bar-container {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1040;
}

.search-input-group {
    border: 2px solid var(--pnl-primary);
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 125, 211, 0.1);
    display: flex;
    align-items: stretch;
    position: relative;
}

.search-category-btn {
    border: none;
    background-color: #f8fafc;
    border-right: 1px solid var(--pnl-border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pnl-text-main);
    padding: 0.5rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.search-category-btn:hover {
    background-color: #f1f5f9;
}

.search-input-field {
    border: none;
    outline: none;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    width: 100%;
    color: var(--pnl-text-main);
}

.search-input-field:focus {
    outline: none;
    box-shadow: none;
}

.search-submit-btn {
    border: none;
    background-color: var(--pnl-primary);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
}

.search-submit-btn:hover {
    background-color: var(--pnl-primary-dark);
}

#searchCategoryMenu {
    z-index: 1060 !important;
}

/* Keranjang & User Action Buttons */
.cart-header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 10px;
    border: 1px solid var(--pnl-border);
    background-color: #ffffff;
    color: var(--pnl-text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.cart-header-btn:hover {
    border-color: var(--pnl-primary);
    color: var(--pnl-primary);
    background-color: var(--pnl-primary-subtle);
}

.search-category-btn > i,
.search-submit-btn > i,
.cart-header-btn > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: 0;
}

.search-category-btn > i::before,
.search-submit-btn > i::before,
.cart-header-btn > i::before {
    vertical-align: 0 !important;
}

.cart-header-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--pnl-accent-orange);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.3);
}

/* User Greeting Avatar */
.user-account-dropdown .btn-user-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--pnl-border);
    background: #ffffff;
    color: var(--pnl-text-main);
    text-decoration: none;
    font-size: 0.875rem;
}

.user-avatar-circle {
    width: 32px;
    height: 32px;
    background-color: var(--pnl-primary-subtle);
    color: var(--pnl-primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

/* --- Hero Banner Carousel (Murni Background Gambar Tanpa Text & Tombol) --- */
.hero-promo-carousel {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hero-banner-clean-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 380;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

@media (max-width: 576px) {
    .hero-banner-clean-img {
        aspect-ratio: 1200 / 480;
    }
}

/* --- Quick Category Bar ala KlikIndogrosir (1 Baris Saja) --- */
.quick-categories-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 0.75rem 1rem 0.65rem 1rem;
    border: 1px solid var(--pnl-border);
    box-shadow: var(--pnl-card-shadow);
}

.quick-categories-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.quick-categories-row::-webkit-scrollbar {
    display: none;
}

.quick-category-item {
    flex: 1 1 0;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--pnl-text-main);
    transition: all 0.15s ease-in-out;
    padding: 0.35rem 0.25rem;
    border-radius: 12px;
    border: 1.5px solid transparent;
}

.quick-category-item:hover {
    transform: translateY(-2px);
    color: var(--pnl-primary);
}

.quick-category-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.quick-category-item:hover .quick-category-icon-wrapper {
    transform: scale(1.05);
}

.quick-category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
}

.icon-bg-sayur-daun {
    background-color: #dcfce7;
    color: #15803d;
}

.icon-bg-sayur-buah {
    background-color: #ffedd5;
    color: #ea580c;
}

.icon-bg-umbi {
    background-color: #fef3c7;
    color: #b45309;
}

.icon-bg-buah {
    background-color: #fee2e2;
    color: #dc2626;
}

.icon-bg-semua {
    background-color: #e0f2fe;
    color: var(--pnl-primary);
}

.quick-category-name {
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Value Proposition Bar --- */
.value-proposition-bar {
    background: #ffffff;
    border: 1px solid var(--pnl-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.vp-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vp-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--pnl-primary-subtle);
    color: var(--pnl-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.vp-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--pnl-text-main);
    margin-bottom: 0.125rem;
}

.vp-desc {
    font-size: 0.75rem;
    color: var(--pnl-text-muted);
    margin-bottom: 0;
}

/* --- Wholesale Product Card (Seragam & Mobile Friendly) --- */
.product-card {
    background: #ffffff;
    border: 1px solid var(--pnl-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--pnl-card-shadow);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pnl-card-shadow-hover);
    border-color: #cbd5e1;
}

.product-card-visual {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.product-card-visual i {
    font-size: 4rem;
    color: var(--pnl-primary);
    opacity: 0.35;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-visual i {
    transform: scale(1.08);
    opacity: 0.45;
}

.product-category-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    color: var(--pnl-text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--pnl-border);
    z-index: 2;
}

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

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pnl-text-main);
    margin-bottom: 0.25rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    height: 2.7em;
}

.product-desc {
    font-size: 0.78rem;
    color: var(--pnl-text-muted);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    height: 2.4em;
}

/* Pricing & Wholesale Tier Box */
.product-pricing-box {
    background-color: #f8fafc;
    border: 1px solid var(--pnl-border);
    border-radius: 10px;
    padding: 0.65rem;
    margin-top: auto;
    margin-bottom: 0.875rem;
}

.price-main {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pnl-primary);
}

.wholesale-tier-pills {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap !important;
    gap: 0.25rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--pnl-border);
    height: 86px;
    min-height: 86px;
    overflow: hidden;
    box-sizing: border-box;
}

.tier-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1.2;
}

.tier-pill .tier-qty {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.tier-pill .tier-price {
    color: var(--pnl-primary);
    font-weight: 700;
    white-space: nowrap;
    margin-left: 0.5rem;
}

@media (max-width: 576px) {
    .product-card-visual {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }
    .product-card-body {
        padding: 0.75rem;
    }
    .product-name {
        font-size: 0.85rem;
        min-height: 2.6em;
        height: 2.6em;
    }
    .product-desc {
        display: none;
    }
    .price-main {
        font-size: 0.92rem;
    }
    .wholesale-tier-pills {
        height: 86px;
        min-height: 86px;
    }
    .btn-quick-add {
        padding: 0.45rem 0.5rem;
        font-size: 0.8125rem;
    }
}

.price-unit {
    font-size: 0.8125rem;
    font-weight: normal;
    color: var(--pnl-text-muted);
}


/* Action Buttons */
.btn-quick-add {
    background-color: var(--pnl-primary);
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background-color 0.15s ease;
    min-height: 40px;
    line-height: 1.25;
    text-align: center;
    vertical-align: middle;
}

.btn-quick-add > i,
.btn-quick-add > .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: 0;
}

.btn-quick-add > i::before,
.btn-quick-add > .bi::before {
    vertical-align: 0 !important;
}

.btn-quick-add > span {
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
}

.btn-quick-add:hover {
    background-color: var(--pnl-primary-dark);
    color: #ffffff;
}

/* --- Modal Fast Login & Register Promo Banner --- */
.modal-login-quick .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-google-login-custom {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google-login-custom:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Footer Ritel Modern */
.customer-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--pnl-border);
    color: var(--pnl-text-muted);
    font-size: 0.875rem;
}

.customer-footer h6 {
    color: var(--pnl-text-main);
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.customer-footer a {
    color: var(--pnl-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.customer-footer a:hover {
    color: var(--pnl-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-slide {
        padding: 2rem 1.25rem;
        min-height: 220px;
    }
    .hero-title {
        font-size: 1.35rem;
    }
    .hero-subtitle {
        font-size: 0.875rem;
    }
    .search-bar-container {
        max-width: 100%;
    }
    .quick-category-icon-wrapper {
        width: 58px;
        height: 58px;
        font-size: 1.75rem;
    }
    .quick-category-item {
        min-width: 76px;
        padding: 0.3rem 0.15rem;
    }
}

/* ==========================================================================
   Brand Palette Components & Bootstrap Utilities (Modern Wholesale Azure)
   ========================================================================== */

/* Primary Button (Brand Azure Blue) */
.btn-primary {
    background-color: var(--pnl-primary) !important;
    border-color: var(--pnl-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pnl-primary-dark) !important;
    border-color: var(--pnl-primary-dark) !important;
    color: #ffffff !important;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 125, 211, 0.25) !important;
}

.btn-primary:active {
    background-color: #005491 !important;
    border-color: #005491 !important;
}

/* Outline Primary Button */
.btn-outline-primary {
    color: var(--pnl-primary) !important;
    border-color: var(--pnl-primary) !important;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
    background-color: var(--pnl-primary) !important;
    border-color: var(--pnl-primary) !important;
    color: #ffffff !important;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 125, 211, 0.25) !important;
}

/* Primary Text & Background Utilities (WCAG AA Compliant) */
.text-primary {
    color: #006cb8 !important; /* Accessible high-contrast azure on white (4.8:1) */
}

.bg-primary {
    background-color: var(--pnl-primary) !important;
    color: #ffffff !important;
}

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

.border-primary {
    border-color: var(--pnl-primary) !important;
}

.border-primary-subtle {
    border-color: #bae6fd !important;
}

/* Badge Tweaks for Brand Clarity */
.badge.bg-primary-subtle {
    color: var(--pnl-primary-text) !important;
    background-color: var(--pnl-primary-subtle) !important;
}

.badge.bg-success-subtle {
    color: var(--pnl-secondary-text) !important;
    background-color: var(--pnl-secondary-subtle) !important;
}

/* Quick Category Active State Highlight */
.quick-category-item.active,
.quick-category-item.is-active {
    border: 2px solid var(--pnl-primary) !important;
    background-color: #f0f9ff !important;
}

