/* FreshBasket - Customer Frontend Styles */
:root {
    --fb-primary: #2d6a4f;
    --fb-primary-dark: #1b4332;
    --fb-primary-light: #40916c;
    --fb-accent: #f77f00;
    --fb-accent-light: #fcbf49;
    --fb-bg: #f8f9fa;
    --fb-dark: #1a1a2e;
    --fb-text: #333;
    --fb-muted: #6c757d;
    --fb-border: #e9ecef;
    --fb-radius: 12px;
    --fb-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --fb-transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--fb-text);
    background: var(--fb-bg);
    padding-bottom: 80px;
}

/* Top Bar */
.top-bar {
    background: var(--fb-primary-dark);
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 0;
}

/* Header */
.site-header {
    background: #fff;
    box-shadow: var(--fb-shadow);
    z-index: 1030;
    padding: 12px 0;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fb-primary);
}

.location-selector {
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--fb-border);
    border-radius: var(--fb-radius);
    cursor: pointer;
    transition: var(--fb-transition);
    min-width: 180px;
}

.location-selector:hover { border-color: var(--fb-primary); }

.search-box { position: relative; max-width: 500px; }

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-form .bi-search {
    position: absolute;
    left: 14px;
    color: var(--fb-muted);
    z-index: 2;
}

.search-form .form-control {
    padding-left: 40px;
    border-radius: 25px;
    border: 2px solid var(--fb-border);
    height: 44px;
    transition: var(--fb-transition);
}

.search-form .form-control:focus {
    border-color: var(--fb-primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow);
    z-index: 1050;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.show { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--fb-text);
    transition: var(--fb-transition);
}

.search-result-item:hover { background: var(--fb-bg); }

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--fb-text);
    border-radius: var(--fb-radius);
    transition: var(--fb-transition);
    position: relative;
}

.header-action:hover { background: var(--fb-bg); color: var(--fb-primary); }
.header-action i { font-size: 1.3rem; }

.cart-badge {
    position: absolute;
    top: 0;
    right: 4px;
    background: var(--fb-accent);
    color: #fff;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Hero Banner */
.hero-slider { margin-bottom: 24px; }

.hero-slide {
    border-radius: var(--fb-radius);
    overflow: hidden;
    position: relative;
    min-height: 280px;
    background: linear-gradient(135deg, var(--fb-primary) 0%, var(--fb-primary-light) 100%);
    display: flex;
    align-items: center;
    padding: 40px;
    color: #fff;
}

.hero-slide.banner-1 { background: linear-gradient(135deg, #2d6a4f 0%, #52b788 100%); }
.hero-slide.banner-2 { background: linear-gradient(135deg, #f77f00 0%, #fcbf49 100%); }
.hero-slide.banner-3 { background: linear-gradient(135deg, #1b4332 0%, #40916c 100%); }

.hero-content h2 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.hero-content p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 20px; }

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Section */
.section { margin-bottom: 32px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fb-dark);
    margin: 0;
}

.section-title i { color: var(--fb-primary); margin-right: 8px; }

/* Categories */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--fb-text);
    padding: 16px 8px;
    border-radius: var(--fb-radius);
    transition: var(--fb-transition);
    background: #fff;
    box-shadow: var(--fb-shadow);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    color: var(--fb-primary);
}

.category-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8f3dc, #b7e4c7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--fb-primary);
    margin-bottom: 8px;
}

.category-name { font-size: 0.85rem; font-weight: 600; text-align: center; }

/* Product Card */
.product-card {
    background: #fff;
    border-radius: var(--fb-radius);
    overflow: hidden;
    box-shadow: var(--fb-shadow);
    transition: var(--fb-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.product-card.out-of-stock { opacity: 0.7; }

.product-img-wrap {
    position: relative;
    padding-top: 100%;
    background: #f0f0f0;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--fb-transition);
}

.product-card:hover .product-img { transform: scale(1.05); }

.btn-wishlist {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: var(--fb-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--fb-transition);
    z-index: 2;
}

.btn-wishlist:hover, .btn-wishlist.active { color: #e63946; }
.btn-wishlist.active i::before { content: "\f415"; }

.product-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fb-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.product-name:hover { color: var(--fb-primary); }

.product-price { font-size: 1.1rem; font-weight: 700; color: var(--fb-primary); }

.product-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }

.stock-badge { color: var(--fb-primary-light); font-size: 0.75rem; }
.out-of-stock .stock-badge { color: #e63946; }

.btn-primary {
    background: var(--fb-primary);
    border-color: var(--fb-primary);
    border-radius: 8px;
}

.btn-primary:hover { background: var(--fb-primary-dark); border-color: var(--fb-primary-dark); }

.btn-accent {
    background: var(--fb-accent);
    border-color: var(--fb-accent);
    color: #fff;
    border-radius: 8px;
}

.btn-accent:hover { background: #e06c00; border-color: #e06c00; color: #fff; }

/* Brand Cards */
.brand-card {
    background: #fff;
    border-radius: var(--fb-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--fb-shadow);
    transition: var(--fb-transition);
    text-decoration: none;
    color: var(--fb-text);
    display: block;
}

.brand-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fb-primary);
}

/* Product Detail */
.product-gallery .main-image {
    width: 100%;
    border-radius: var(--fb-radius);
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f0f0;
}

.thumb-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--fb-transition);
}

.thumb-img.active, .thumb-img:hover { border-color: var(--fb-primary); }

.variant-btn {
    padding: 8px 16px;
    border: 2px solid var(--fb-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: var(--fb-transition);
    font-size: 0.9rem;
}

.variant-btn.active, .variant-btn:hover {
    border-color: var(--fb-primary);
    background: rgba(45,106,79,0.1);
    color: var(--fb-primary);
}

/* Cart */
.cart-item {
    background: #fff;
    border-radius: var(--fb-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--fb-shadow);
    display: flex;
    gap: 16px;
    align-items: center;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    overflow: hidden;
}

.qty-control button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--fb-bg);
    cursor: pointer;
    font-weight: 700;
}

.qty-control span {
    width: 36px;
    text-align: center;
    font-weight: 600;
}

.cart-summary {
    background: #fff;
    border-radius: var(--fb-radius);
    padding: 24px;
    box-shadow: var(--fb-shadow);
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--fb-border);
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: none;
    color: var(--fb-primary);
    padding-top: 12px;
}

/* Order Tracking */
.tracking-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 32px 0;
}

.tracking-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--fb-border);
    z-index: 0;
}

.tracking-step {
    text-align: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: #fff;
    font-size: 1rem;
}

.tracking-step.active .step-icon,
.tracking-step.completed .step-icon {
    background: var(--fb-primary);
}

.tracking-step.completed .step-icon { background: var(--fb-primary-light); }

.step-label { font-size: 0.75rem; font-weight: 600; color: var(--fb-muted); }
.tracking-step.active .step-label { color: var(--fb-primary); }

/* Auth Pages */
.auth-card {
    max-width: 440px;
    margin: 40px auto;
    background: #fff;
    border-radius: var(--fb-radius);
    padding: 32px;
    box-shadow: var(--fb-shadow);
}

.auth-card .logo { justify-content: center; margin-bottom: 24px; }

/* Sticky Cart */
.sticky-cart-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fb-primary);
    color: #fff;
    padding: 12px 32px;
    border-radius: 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(45,106,79,0.4);
    z-index: 1020;
    font-weight: 600;
    transition: var(--fb-transition);
}

.sticky-cart-btn:hover { background: var(--fb-primary-dark); color: #fff; transform: translateX(-50%) scale(1.05); }

.sticky-cart-count {
    background: var(--fb-accent);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Footer */
.site-footer {
    background: var(--fb-dark);
    color: #ccc;
    padding: 48px 0 24px;
    margin-top: 48px;
}

.site-footer h6 { color: #fff; font-weight: 600; margin-bottom: 16px; }

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #aaa; text-decoration: none; transition: var(--fb-transition); }
.footer-links a:hover { color: #fff; }

.footer-contact { list-style: none; padding: 0; }
.footer-contact li { margin-bottom: 10px; display: flex; gap: 8px; align-items: flex-start; }

.social-links { display: flex; gap: 12px; }
.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: var(--fb-transition);
}
.social-links a:hover { background: var(--fb-primary); }

/* Star Rating */
.star-rating { display: inline-flex; gap: 2px; font-size: 0.85rem; }

/* Filters Sidebar */
.filter-sidebar {
    background: #fff;
    border-radius: var(--fb-radius);
    padding: 20px;
    box-shadow: var(--fb-shadow);
}

.filter-sidebar h6 { font-weight: 700; margin-bottom: 12px; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

/* Responsive */
@media (max-width: 768px) {
    .hero-slide { min-height: 200px; padding: 24px; }
    .hero-content h2 { font-size: 1.4rem; }
    .section-title { font-size: 1.1rem; }
    body { padding-bottom: 100px; }
}

@media (min-width: 769px) {
    .sticky-cart-btn { display: none !important; }
}
