/**
 * E-Commerce Storefront Styles
 * Hardware & Paint Shop — Premium Hardware / Industrial theme
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand palette — deep navy + amber */
    --navy:        #12263f;
    --navy-2:      #1b3557;
    --primary:     #16304d;
    --primary-dark:#0e2036;
    --accent:      #f59e0b;   /* amber */
    --accent-dark: #d97706;
    --accent-soft: #fff7ea;
    --success:     #0f9d6a;
    --danger:      #dc3545;
    --ink:         #0f1b2d;
    --steel:       #5b6b80;
    --line:        #e3e8ef;
    --light:       #eef2f7;
    --radius:      14px;
    --radius-sm:   9px;
    --shadow-sm:   0 1px 2px rgba(16,32,58,.06), 0 1px 3px rgba(16,32,58,.05);
    --shadow-md:   0 6px 20px rgba(16,32,58,.10);
    --shadow-lg:   0 18px 45px rgba(16,32,58,.16);

    /* Override Bootstrap primary so existing utility classes adopt the brand */
    --bs-primary:      #16304d;
    --bs-primary-rgb:  22, 48, 77;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--ink);
    /* leave room for the fixed mobile bottom nav, respecting the iOS home indicator */
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    body { padding-bottom: 0; }
}

/* ---- Mobile search bar ---- */
.mobile-search {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1019;
}
.mobile-search .form-control { border-color: var(--line); }
.mobile-search .form-control:focus { box-shadow: none; border-color: var(--navy-2); }

/* ---- Mobile responsiveness polish ---- */
@media (max-width: 991px) {
    .navbar .navbar-collapse .d-flex.mx-auto { display: none !important; } /* desktop search hidden; mobile search bar used instead */
}
@media (max-width: 575px) {
    .container, .container-fluid { padding-left: 14px; padding-right: 14px; }
    .section-title { font-size: 1.2rem; }
    .hero-section h1 { font-size: 1.6rem; }
    .btn-lg { padding: .6rem 1.1rem; font-size: .95rem; }
    .promo-band { padding: 22px 18px; text-align: center; }
    .promo-band .col-lg-4 { text-align: center !important; }
    .card-body { padding: 14px; }
}

/* Comfortable tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .dropdown-item, .mobile-nav-item, .qty-control button { min-height: 42px; }
    .btn-add-cart { min-height: 40px; }
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .section-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

/* ---- Bootstrap utility overrides (keeps existing markup on-theme) ---- */
.bg-dark      { background-color: var(--navy) !important; }
.bg-primary   { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
a { color: var(--primary); }
a:hover { color: var(--navy-2); }

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    font-weight: 600;
    letter-spacing: .01em;
}
.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary);
    font-weight: 600;
}
/* Amber accent button for primary CTAs */
.btn-accent {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #23180a;
    font-weight: 700;
    letter-spacing: .01em;
    transition: all .2s ease;
}
.btn-accent:hover, .btn-accent:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.btn { border-radius: var(--radius-sm); }
.text-accent { color: var(--accent-dark) !important; }
.badge { font-weight: 600; letter-spacing: .02em; }

/* ---- Top bar ---- */
.topbar {
    font-size: .82rem;
    letter-spacing: .01em;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar .bi { color: var(--accent); }

/* ---- Navbar ---- */
.navbar {
    border-bottom: 1px solid var(--line);
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.navbar-brand {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--navy) !important;
    display: flex;
    align-items: center;
}
.navbar-brand .bi {
    color: var(--accent);
    margin-right: .45rem;
}
.navbar .form-control {
    border-color: var(--line);
    border-right: none;
    padding: .58rem .9rem;
}
.navbar .form-control:focus {
    box-shadow: none;
    border-color: var(--navy-2);
}
.navbar .input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.navbar-nav .nav-link { color: var(--ink); }
.navbar-nav .nav-link:hover { color: var(--primary); }

/* ---- Category bar ---- */
.category-bar { background: #fff !important; }
.category-bar .nav-link {
    font-weight: 600;
    color: var(--steel) !important;
    border-radius: 6px;
    transition: all .15s ease;
}
.category-bar .nav-link:hover { color: var(--primary) !important; background: var(--light); }
.category-bar .nav-link.fw-bold { color: var(--navy) !important; }

/* ---- Hero / Banner ---- */
.hero-section {
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(245,158,11,.18), transparent 60%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    padding: 72px 0;
    border-radius: 0 0 22px 22px;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
}
.hero-section > .container { position: relative; z-index: 1; }
.hero-section h1 { font-size: 2.7rem; font-weight: 800; line-height: 1.1; }
.hero-section .lead { color: rgba(255,255,255,.82); }
.hero-section .btn-accent { box-shadow: 0 8px 24px rgba(245,158,11,.35); }

@media (max-width: 768px) {
    .hero-section { padding: 44px 0; }
    .hero-section h1 { font-size: 1.9rem; }
}

/* Banner Carousel */
.banner-carousel .carousel-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
}
@media (max-width: 768px) {
    .banner-carousel .carousel-item img { height: 180px; }
}

/* ---- Trust / feature strip ---- */
.trust-strip {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.trust-strip .trust-item { display: flex; align-items: center; gap: 12px; padding: 14px 8px; }
.trust-strip .trust-item .bi { font-size: 1.5rem; color: var(--accent-dark); }
.trust-strip .trust-item small { color: var(--steel); }
.trust-strip .trust-item strong { color: var(--ink); font-weight: 700; }

/* ---- Product Card ---- */
.product-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    background: #fff;
    box-shadow: var(--shadow-sm);
    height: 100%;
    position: relative;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #d3dbe6;
}
.product-card .card-img-top {
    height: 210px;
    object-fit: contain;
    padding: 22px;
    background: linear-gradient(180deg, #fbfcfe, #f2f5f9);
    border-bottom: 1px solid var(--line);
}
@media (max-width: 576px) {
    .product-card .card-img-top { height: 155px; padding: 15px; }
}
.product-card .card-body { padding: 16px; }
.product-card .product-title {
    font-size: .92rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    color: var(--ink);
}
.product-card .product-title:hover { color: var(--primary); }
.product-card .product-price {
    font-size: 1.18rem;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
    color: var(--navy);
}
.product-card .product-mrp {
    text-decoration: line-through;
    color: #9aa7b6;
    font-size: .85rem;
}
.product-card .product-discount {
    color: var(--success);
    font-weight: 700;
    font-size: .8rem;
}
.product-card .btn-add-cart {
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 700;
    padding: 7px 16px;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #23180a;
    transition: all .2s ease;
}
.product-card .btn-add-cart:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.product-card .badge-stock {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: .68rem;
    padding: .32em .6em;
}
.product-card .btn-wishlist {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
    z-index: 2;
}
.product-card .btn-wishlist:hover, .product-card .btn-wishlist.active {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fecdd3;
}

/* ---- Section head ---- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 12px; }
.section-head .section-title { margin-bottom: 0; }
.section-sub { color: var(--steel); font-size: .85rem; margin-top: 2px; }

/* ---- Horizontal product carousel / scroller ---- */
.product-scroller { position: relative; }
.scroller-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding: 4px 2px 14px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scroller-track::-webkit-scrollbar { display: none; }
.scroller-track > .scroller-item { flex: 0 0 auto; width: 230px; scroll-snap-align: start; }
@media (max-width: 576px) { .scroller-track > .scroller-item { width: 165px; } }

.scroller-arrow {
    position: absolute; top: 42%; transform: translateY(-50%); z-index: 5;
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--navy);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; font-size: 1.1rem;
}
.scroller-arrow:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.scroller-arrow.prev { left: -10px; }
.scroller-arrow.next { right: -10px; }
@media (max-width: 768px) { .scroller-arrow { display: none; } }

/* Trending flair */
.trending-band { background: linear-gradient(135deg, #fff7ea 0%, #fff 60%); border: 1px solid #f6e2c0; border-radius: var(--radius); padding: 20px 18px 8px; }
.hot-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--accent); color: #23180a; font-weight: 700; font-size: .72rem; padding: 3px 10px; border-radius: 20px; letter-spacing: .02em; }

/* ---- Promo / CTA band ---- */
.promo-band {
    background:
        radial-gradient(900px 300px at 90% -20%, rgba(245,158,11,.22), transparent 60%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff; border-radius: var(--radius); padding: 34px 28px; overflow: hidden;
}
.promo-band h4 { font-weight: 800; }
.promo-band .lead { color: rgba(255,255,255,.82); }

/* ---- Category Card ---- */
.category-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    padding: 22px 12px;
    transition: all .25s;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.category-card .icon {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 10px;
    transition: color .2s;
}
.category-card:hover .icon { color: var(--accent-dark); }

/* Rating Stars */
.stars { color: var(--accent); }
.stars .bi-star { color: #d8dee6; }

/* ---- Cart ---- */
.cart-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 82px; height: 82px; object-fit: contain; border-radius: var(--radius-sm); background: #f5f7fa; border: 1px solid var(--line); }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.qty-control button { border: none; background: #f2f5f9; width: 34px; height: 34px; font-size: 1rem; color: var(--ink); cursor: pointer; transition: background .15s; }
.qty-control button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.qty-control input { border: none; width: 42px; text-align: center; font-weight: 700; }

/* ---- Checkout steps ---- */
.step-indicator { display: flex; gap: 0; margin-bottom: 30px; }
.step-indicator .step { flex: 1; text-align: center; padding: 12px 0; border-bottom: 3px solid var(--line); color: #94a3b8; font-size: .85rem; font-weight: 600; }
.step-indicator .step.active { border-color: var(--accent); color: var(--accent-dark); }
.step-indicator .step.done { border-color: var(--success); color: var(--success); }

/* ---- Order timeline ---- */
.order-timeline { position: relative; padding-left: 30px; }
.order-timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.order-timeline .timeline-item { position: relative; margin-bottom: 20px; }
.order-timeline .timeline-item::before { content: ''; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.order-timeline .timeline-item.active::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(245,158,11,.22); }
.order-timeline .timeline-item.done::before { background: var(--success); }

/* ---- Mobile bottom nav ---- */
.mobile-nav { z-index: 1040; padding-bottom: env(safe-area-inset-bottom, 0px); }
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--steel);
    font-size: .7rem;
    gap: 2px;
}
.mobile-nav-item i { font-size: 1.3rem; }
.mobile-nav-item.active { color: var(--primary); }

/* ---- Section headers ---- */
.section-title {
    font-weight: 800;
    font-size: 1.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    color: var(--navy);
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

/* ---- Filters sidebar ---- */
.filter-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.filter-section h6 { font-weight: 700; margin-bottom: 12px; color: var(--navy); }

/* ---- Footer ---- */
footer.bg-dark { position: relative; }
footer.bg-dark::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent 60%);
}
footer h5, footer h6 { font-family: 'Manrope', sans-serif; }
footer h5 .bi { color: var(--accent); }
footer a.text-white-50:hover { color: var(--accent) !important; }
footer .d-flex a.text-white-50:hover { color: var(--accent) !important; }

/* ---- PWA Install Banner ---- */
.pwa-install-banner {
    position: fixed;
    bottom: 75px;
    left: 15px;
    right: 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    display: none;
}
@media (min-width: 992px) {
    .pwa-install-banner { bottom: 20px; left: auto; right: 20px; max-width: 350px; }
}

/* ---- Loading skeleton ---- */
.skeleton { background: linear-gradient(90deg, #edf1f5 25%, #e2e8f0 50%, #edf1f5 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ---- Search suggestions ---- */
#searchSuggestions { position: absolute; top: 100%; left: 0; z-index: 1060; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#searchSuggestions .dropdown-item { white-space: normal; font-size: .85rem; padding: 8px 12px; }
#searchSuggestions .dropdown-item:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* ============================================================
   AI Chatbot Widget
   ============================================================ */
.chatbot-fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1090;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff;
    border: 2px solid var(--accent);
    box-shadow: 0 6px 22px rgba(18,38,63,.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all .3s ease;
}
.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(18,38,63,.6);
}
.chatbot-fab .badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid #fff;
}

@media (min-width: 992px) {
    .chatbot-fab { bottom: 28px; }
}

.chatbot-window {
    position: fixed;
    bottom: 150px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 180px);
    z-index: 1091;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp .3s ease;
}
.chatbot-window.open { display: flex; }

@media (min-width: 992px) {
    .chatbot-window { bottom: 96px; }
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chatbot-header .bot-avatar {
    width: 38px;
    height: 38px;
    background: rgba(245,158,11,.22);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.chatbot-header .bot-info h6 { margin: 0; font-size: .95rem; font-weight: 700; }
.chatbot-header .bot-info small { opacity: .8; font-size: .75rem; }
.chatbot-header .btn-close-chat {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s;
}
.chatbot-header .btn-close-chat:hover { opacity: 1; }

.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f1f5f9;
}
.chatbot-body::-webkit-scrollbar { width: 4px; }
.chatbot-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: .85rem;
    line-height: 1.55;
    word-wrap: break-word;
}
.chat-msg.bot {
    background: #fff;
    color: var(--ink);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}
.chat-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg.bot strong, .chat-msg.bot b { color: var(--primary); }
.chat-msg.bot a { color: var(--accent-dark); text-decoration: underline; }

.chat-msg.bot .typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    margin: 0 2px;
    animation: typingBounce 1.4s infinite ease-in-out;
}
.chat-msg.bot .typing-dots span:nth-child(2) { animation-delay: .2s; }
.chat-msg.bot .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(.6); opacity: .4; }
    40% { transform: scale(1); opacity: 1; }
}

.chatbot-footer {
    padding: 12px;
    border-top: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}
.chatbot-footer form {
    display: flex;
    gap: 8px;
}
.chatbot-footer input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: .85rem;
    outline: none;
    transition: border-color .2s;
}
.chatbot-footer input:focus { border-color: var(--primary); }
.chatbot-footer button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.chatbot-footer button:hover { background: var(--primary-dark); }

.chat-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.chat-quick-btns button {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid #f6e2c0;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: .75rem;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.chat-quick-btns button:hover { background: #ffeecc; }
