/**
 * Omahia Marketplace - Frontend Styles
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #0f172a;
    --light: #f8fafc;
    --body-bg: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    color: #334155;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--primary-dark); }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--dark); }

/* Top Bar */
.top-bar { font-size: 0.8125rem; }

/* Header */
.main-header { z-index: 1020; }

.search-form .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border: 2px solid var(--border);
    border-right: none;
    padding: 10px 16px;
    font-size: 0.875rem;
}

.search-form .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.search-form .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 10px 20px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
}

.header-icon-btn {
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.header-icon-btn:hover {
    background: var(--light);
    color: var(--primary);
}

/* Navigation */
.navbar-light .navbar-nav .nav-link {
    color: #475569;
    font-size: 0.875rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.mega-menu {
    min-width: 600px;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
}

.mega-menu .dropdown-header {
    font-size: 0.875rem;
    color: var(--dark);
    padding: 8px 16px;
}

.mega-menu .dropdown-item {
    font-size: 0.8125rem;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    color: #475569;
}

.mega-menu .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Hero Section */
.hero-section { position: relative; }

.hero-slide {
    min-height: 420px;
    display: flex;
    align-items: center;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
}

/* Category Cards */
.category-card .card {
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

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

.category-card .category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    margin: 0 auto;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border-radius: var(--radius);
    overflow: hidden;
}

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

.product-card .card-img-top {
    transition: transform 0.3s ease;
}

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

.product-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-actions .btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-wishlist:hover i {
    color: var(--danger) !important;
}

/* Star Rating */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating .fa-star, .star-rating .fa-star-half-alt { font-size: 0.75rem; }

/* Vendor Cards */
.vendor-card .card {
    transition: all 0.3s ease;
}

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

/* Promo Banner */
.promo-banner { position: relative; }

/* Hover lift utility */
.hover-lift { transition: all 0.3s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg) !important; }

/* Buttons */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 0.875rem; padding: 8px 16px; }

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

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

/* Cards */
.card { border-radius: var(--radius); border: none; }

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 14px;
    font-size: 0.875rem;
}

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

/* Footer */
.main-footer { font-size: 0.875rem; }

.footer-links li { margin-bottom: 8px; }

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.social-links { display: flex; gap: 8px; }

.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    transition: all 0.2s;
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Product Detail */
.product-gallery .main-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: #f8fafc;
}

.product-gallery .main-image img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.thumbnail-list img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail-list img:hover,
.thumbnail-list img.active {
    border-color: var(--primary);
}

.price-display .current-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.price-display .old-price {
    font-size: 1.125rem;
    color: var(--secondary);
    text-decoration: line-through;
}

.price-display .discount-badge {
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Quantity Input */
.qty-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.qty-input button {
    background: var(--light);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-input button:hover { background: var(--border); }

.qty-input input {
    border: none;
    width: 50px;
    text-align: center;
    font-weight: 600;
    padding: 8px 0;
}

.qty-input input:focus { outline: none; }

/* Cart */
.cart-item {
    transition: all 0.2s;
    border-radius: var(--radius);
}

.cart-item:hover {
    background: var(--light);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Checkout */
.checkout-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.3s;
}

.checkout-step.active {
    background: var(--primary);
    color: #fff;
}

.checkout-step.completed {
    background: var(--success);
    color: #fff;
}

.checkout-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
}

.checkout-connector.completed {
    background: var(--success);
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

/* Breadcrumb */
.breadcrumb-wrapper {
    background: var(--light);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb { margin-bottom: 0; font-size: 0.8125rem; }

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

/* Pagination */
.pagination { gap: 4px; }
.page-item .page-link {
    border: none;
    border-radius: var(--radius-sm);
    color: var(--dark);
    font-weight: 500;
    padding: 8px 14px;
}
.page-item.active .page-link { background: var(--primary); }
.page-item .page-link:hover { background: var(--primary-light); color: var(--primary); }

/* Filters */
.filter-sidebar .filter-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.filter-sidebar .filter-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.price-range-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reviews */
.review-card {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.review-card:last-child { border-bottom: none; }

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
}

/* Responsive */
@media (max-width: 767.98px) {
    .hero-slide { min-height: 300px; }
    .hero-slide h1 { font-size: 1.75rem; }
    .hero-slide .lead { font-size: 1rem; }
    
    .mega-menu { min-width: 100%; }
    
    .auth-card { padding: 24px; }
    
    .product-card .card-img-top { height: 160px; }
}

@media (max-width: 575.98px) {
    .hero-slide { min-height: 250px; }
    .hero-slide h1 { font-size: 1.5rem; }
    
    .stat-number { font-size: 1.5rem; }
    
    .footer-links { margin-bottom: 24px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Selection */
::selection {
    background: var(--primary);
    color: #fff;
}
