/* ============================================================
   Electronics Spears Shop — Custom Styles
   ============================================================ */

:root {
    --primary: #0d47a1;
    --secondary: #1565c0;
    --accent: #ffc107;
    --dark: #121212;
    --light-bg: #f5f7fa;
}

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: #2c2c2c;
}

a {
    color: var(--primary);
}

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

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

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

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

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    font-size: 0.78rem;
    background-color: #0a0a0a !important;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.category-nav {
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav .nav-link:hover {
    color: var(--accent) !important;
}

/* ── Hero Banner ─────────────────────────────────────────── */
.hero-banner {
    background: linear-gradient(135deg, #0d47a1 0%, #1a237e 100%);
    color: white;
    padding: 70px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.hero-banner .display-4 {
    font-weight: 800;
}

/* ── Hero Slider ─────────────────────────────────────────────── */
.hero-slider {
    position: relative;
}
.hero-slider .carousel-item {
    min-height: 400px;
}
.hero-slider .carousel-item .hero-banner {
    background: transparent !important;
}
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
    width: 5%;
}
.hero-slider .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: none;
    margin: 0 4px;
}
.hero-slider .carousel-indicators button.active {
    background-color: #ffc107;
}

/* ── Hero Image ─────────────────────────────────────────────── */
.hero-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

/* ── Section Headings ────────────────────────────────────── */
.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ── Product Card ────────────────────────────────────────── */
.product-card {
    border: 1px solid #e8ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    background: #fff;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(13, 71, 161, 0.15);
}

.product-card .card-img-wrapper {
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card .card-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.35s;
}

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

.product-card .badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e53935;
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.product-card .badge-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #000;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.product-card .badge-today-deal {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b00;
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.product-card .card-body {
    padding: 15px;
}

.product-card .product-name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    min-height: 2.7em;
}

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

.product-card .product-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.82rem;
}

.product-card .product-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.product-card .btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* ── Quick Action Buttons on Card ────────────────────────── */
.card-btn-group {
    display: flex;
    gap: 5px;
}

/* ── Category Card ───────────────────────────────────────── */
.category-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    background: #fff;
    border: 1px solid #e8ecef;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.category-card .cat-img-wrapper {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    overflow: hidden;
}

.category-card img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
}

.category-card .card-body {
    padding: 12px;
    text-align: center;
}

.category-card .cat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

/* ── Product Detail Page ─────────────────────────────────── */
.product-main-img-wrapper {
    border: 1px solid #e8ecef;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-main-img-wrapper img {
    max-height: 400px;
    max-width: 100%;
    object-fit: contain;
}

.product-thumb {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #fff;
    padding: 4px;
}

.product-thumb:hover,
.product-thumb.active {
    border-color: var(--primary);
}

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

.price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
}

.discount-badge {
    background: #e53935;
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.82rem;
}

/* ── Star Rating ─────────────────────────────────────────── */
.star-rating {
    font-size: 0.9rem;
}

.star-interactive {
    font-size: 1.5rem;
    cursor: pointer;
    color: #ccc;
}

.star-interactive.checked,
.star-interactive:hover {
    color: var(--accent);
}

/* ── Cart ────────────────────────────────────────────────── */
.cart-item-img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e8ecef;
    background: #fff;
}

.cart-summary {
    background: #fff;
    border: 1px solid #e8ecef;
    border-radius: 12px;
    padding: 24px;
}

/* ── Order Tracking Timeline ─────────────────────────────── */
.tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-step {
    position: relative;
    padding-bottom: 24px;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.timeline-dot.active {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot.completed {
    background: #43a047;
    box-shadow: 0 0 0 2px #43a047;
}

.timeline-dot.cancelled {
    background: #e53935;
    box-shadow: 0 0 0 2px #e53935;
}

/* ── Dashboard Sidebar ───────────────────────────────────── */
.dashboard-sidebar {
    background: #fff;
    border: 1px solid #e8ecef;
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-sidebar .sidebar-header {
    background: var(--primary);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.dashboard-sidebar .nav-link {
    color: #444;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.dashboard-sidebar .nav-link:hover {
    background: #f5f7fa;
    color: var(--primary);
}

.dashboard-sidebar .nav-link.active {
    background: #e3f2fd;
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.dashboard-sidebar .nav-link i {
    width: 22px;
}

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-sidebar {
    width: 250px;
    min-height: 100vh;
    background: #1a1a2e;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    transition: background 0.2s;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

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

.admin-sidebar .nav-link i {
    width: 22px;
}

.admin-content {
    flex: 1;
    overflow: hidden;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e8ecef;
    padding: 12px 24px;
}

.stat-card {
    border-radius: 12px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card-1 {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
}

.stat-card-2 {
    background: linear-gradient(135deg, #43a047, #1b5e20);
}

.stat-card-3 {
    background: linear-gradient(135deg, #fb8c00, #e65100);
}

.stat-card-4 {
    background: linear-gradient(135deg, #e91e63, #880e4f);
}

/* ── Comparison Table ────────────────────────────────────── */
.compare-table th {
    background: var(--primary);
    color: #fff;
    text-align: center;
    vertical-align: middle;
}

.compare-table td {
    text-align: center;
    vertical-align: middle;
}

.compare-table .compare-img {
    max-height: 120px;
    max-width: 120px;
    object-fit: contain;
}

/* ── Coupon Box ──────────────────────────────────────────── */
.coupon-box {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.coupon-applied {
    border-color: #43a047;
    background: #f1f8e9;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge-out-of-stock {
    background: #ef5350;
}

.badge-in-stock {
    background: #43a047;
}

.badge-low-stock {
    background: #ff8f00;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    border: 1px solid #e8ecef;
}

/* ── Responsive Utilities ────────────────────────────────── */
@media (max-width: 768px) {
    .hero-banner {
        padding: 40px 0 50px;
    }

    .hero-banner .display-4 {
        font-size: 1.8rem;
    }

    .product-card .card-img-wrapper {
        height: 160px;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
    }
}

/* ── Misc ────────────────────────────────────────────────── */
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.out-of-stock-overlay span {
    background: #e53935;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 6px;
    transform: rotate(-15deg);
}

.hover-lift {
    transition: transform 0.2s;
}

.hover-lift:hover {
    transform: translateY(-3px);
}

/* Loading spinner */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* Alert styling */
.alert {
    border-radius: 10px;
}

/* Table */
.table-hover tbody tr:hover {
    background: #f0f4ff;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

/* ── Search Autocomplete Dropdown ────────────────────────── */
.search-suggest-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 420px;
    overflow-y: auto;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
}

.search-suggest-item:last-child {
    border-bottom: none;
}

.search-suggest-item:hover,
.search-suggest-item.active {
    background: #f0f4ff;
}

.search-suggest-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

.search-suggest-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #222;
    line-clamp: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-suggest-meta {
    font-size: 0.76rem;
    color: #888;
}

.search-suggest-price {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-suggest-price.sale {
    color: #e53935;
}

.search-suggest-footer {
    padding: 10px 14px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    background: #f8f9ff;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

.search-suggest-footer:hover {
    background: #e8edff;
}

/* ── Tag Input Widget ─────────────────────────────────────── */
.tag-input-wrapper {
    padding: 6px 10px;
    gap: 6px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.tag-pill:hover {
    background: #c62828;
}

.tag-pill .tag-x {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1;
}