/* ============ FleetPride Shared Styles (cart / checkout) ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== Stable loading: prevent layout shift (CLS) ===== */
html { max-width: 100vw; overflow-x: hidden; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
img[loading="lazy"] { background: #f5f5f5; }
.main-content, .products-grid, .categories-grid, .category-section, .featured-section, .wt-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

:root {
    --primary: #1a73e8; --primary-dark: #1557b0; --secondary: #f5f6f8; --accent: #fbbf24;
    --ebay-red: #e53238; --ebay-blue: #0064d2; --ebay-yellow: #f5af02; --ebay-green: #86b817;
    --text-primary: #1e1e1e; --text-secondary: #5a5a5a; --text-muted: #8a8a8a;
    --border-color: #e4e7ec; --card-bg: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --radius: 10px; --radius-sm: 6px;
    --transition: 0.25s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: var(--font); background: #f7f7f7; color: var(--text-primary);
    line-height: 1.5; padding-top: 116px; min-height: 100vh;
    display: flex; flex-direction: column;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
 
/* ===== Top bar ===== */
.top-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1001; background: #f7f7f7; border-bottom: 1px solid #e5e5e5; font-size: 0.7rem; color: #555; }
.top-bar .container { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; min-height: 28px; }
.top-bar .tb-left, .top-bar .tb-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top-bar a { color: #555; white-space: nowrap; transition: color 0.15s; }
.top-bar a:hover { text-decoration: underline; }
.top-bar .signin { color: var(--ebay-blue); font-weight: 600; }
.top-bar .divider { color: #ccc; }
 
/* ===== Header ===== */
.header { position: fixed; top: 28px; left: 0; right: 0; z-index: 1000; background: #fff; border-bottom: 1px solid var(--border-color); box-shadow: 0 2px 4px rgba(0,0,0,0.04); padding: 8px 0; }
.header-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text-primary); white-space: nowrap; flex-shrink: 0; letter-spacing: -0.5px; }
.logo-img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; transition: var(--transition); }
.logo:hover .logo-img { transform: rotate(-4deg) scale(1.05); }
.logo-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.logo-text .brand { font-size: 1rem; font-weight: 700; background: linear-gradient(90deg, var(--ebay-red), var(--ebay-blue), var(--ebay-yellow), var(--ebay-green)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo-text .tag { font-weight: 500; font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
 
.search-wrap { flex: 1; min-width: 160px; display: flex; align-items: stretch; background: #fff; border: 2px solid #111820; border-radius: 4px; overflow: hidden; }
.search-wrap:focus-within { border-color: var(--ebay-blue); box-shadow: 0 0 0 3px rgba(0,100,210,0.15); }
.search-wrap input { flex: 1; border: none; background: transparent; padding: 8px 12px; font-size: 16px; outline: none; min-width: 80px; }
.search-wrap button { background: linear-gradient(180deg, #f7d797 0%, var(--ebay-blue) 100%); color: #fff; padding: 0 22px; font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: var(--transition); }

 
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.action-btn { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 50px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); background: transparent; transition: var(--transition); white-space: nowrap; }
.action-btn i { font-size: 1rem; }

.action-btn.cart { background: var(--secondary); color: var(--text-primary); position: relative; }
.cart-badge { background: var(--ebay-red); color: #fff; font-size: 0.6rem; font-weight: 600; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-left: 2px; }
 
@media (max-width: 768px) {
    body { padding-top: 96px; }
    .top-bar .hide-sm { display: none; }
    .logo-text .tag { display: none; }
    .search-wrap { order: 3; flex-basis: 100%; }
    .search-wrap button { padding: 0 16px; }
    .action-btn span { display: none; }
}
@media (max-width: 480px) {
    .logo-img { width: 34px; height: 34px; }
    .logo-text .brand { font-size: 0.95rem; }
}
 
/* ===== Page heading ===== */
.page-head { padding: 18px 0 12px; }
.page-head h1 { font-size: 1.4rem; font-weight: 700; }
.page-head .crumb { font-size: 1rem; color: var(--text-muted); margin-bottom: 6px; }
.page-head .crumb a { color: var(--ebay-blue); }
.page-head .crumb a:hover { text-decoration: underline; }
@media (max-width: 768px) {
    .page-head .crumb { font-size: 1.8rem; }
}
 
.main-content { flex: 1; padding-bottom: 40px; }
 
/* ===== Footer ===== */
.footer { background: #fff; border-top: 1px solid var(--border-color); padding: 18px 0 14px; margin-top: 12px; font-size: 0.75rem; color: var(--text-muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { font-weight: 500; }

.social-links { display: flex; gap: 12px; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f5f5f5; color: #666; transition: all 0.2s; font-size: 1rem; }
.social-links a:hover { transform: translateY(-2px); }
.social-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.social-wrapper { display: flex; flex-direction: column; align-items: center; }
 
/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1e1e1e; color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 0.8rem; font-weight: 500; box-shadow: 0 8px 32px rgba(0,0,0,0.18); transform: translateY(80px); opacity: 0; transition: all 0.35s ease; z-index: 9999; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
 
/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 50px; font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
.btn-primary { background: linear-gradient(180deg, #f7d797 0%, var(--ebay-blue) 100%); color: #0f1111; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,100,210,0.25); }
.btn-outline { background: #fff; color: var(--text-primary); border: 1.5px solid var(--text-primary); }

.btn:disabled { opacity: 0.5; pointer-events: none; }

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

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

.skeleton-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 16px;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-button {
    height: 40px;
    width: 100%;
    margin-top: 12px;
    border-radius: var(--radius-sm);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-table-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-table-cell {
    flex: 1;
    height: 16px;
}

.skeleton-badge {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

/* ===== Responsive Breakpoints & Layout Styles ===== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1680px;
        padding: 0 24px;
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1400px;
        padding: 0 20px;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .header-inner {
        gap: 8px;
    }
    
    .search-wrap {
        flex: 1;
    }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 12px;
    }
    
    .header-inner {
        gap: 6px;
        padding: 0 8px;
    }
    
    .logo {
        font-size: 0.95rem;
    }
    
    .logo-text .tag {
        display: none;
    }
    
    .search-wrap {
        order: 3;
        flex-basis: 100%;
        min-width: 100%;
        padding: 0;
        border-width: 2px;
        border-radius: 25px;
        height: 44px;
    }
    
    .search-wrap input {
        font-size: 16px;
        padding: 0 16px;
        height: 100%;
    }
    
    .search-wrap button {
        padding: 0 20px;
        height: 100%;
        border-radius: 0 25px 25px 0;
        font-size: 0.9rem;
    }
    
    .search-wrap button span {
        display: none;
    }
    
    .header-actions .action-btn span {
        display: none;
    }
    
    .header-actions .action-btn {
        padding: 6px 8px;
    }
    
    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
    }
}

/* Small Mobile (≤479px) */
@media (max-width: 479px) {
    .container {
        padding: 0 10px;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .logo-text .brand {
        font-size: 0.9rem;
    }
    
    .search-wrap {
        height: 40px;
    }
    
    .search-wrap input {
        font-size: 16px;
        padding: 0 12px;
    }
    
    .search-wrap button {
        padding: 0 16px;
        font-size: 0.85rem;
    }
}

/* ===== Three-Column Layout Styles ===== */
.products-layout {
    display: grid;
    gap: 20px;
}

/* Desktop: 3 columns (categories, products, filters) */
@media (min-width: 1024px) {
    .products-layout {
        grid-template-columns: 240px 1fr 280px;
    }
}

/* Tablet: 2 columns (categories, products) */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-layout {
        grid-template-columns: 200px 1fr;
        gap: 16px;
    }
}

/* Mobile: Single column */
@media (max-width: 767px) {
    .products-layout {
        display: block;
    }
}

/* Large Desktop: Wider columns */
@media (min-width: 1440px) {
    .products-layout {
        grid-template-columns: 280px 1fr 320px;
        gap: 24px;
    }
}

/* ===== Mobile Drawer & Bottom Sheet Styles ===== */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    display: none;
}

.mobile-drawer-overlay.show {
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    z-index: 3000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.show {
    transform: translateX(0);
}

.mobile-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.mobile-bottom-sheet.show {
    transform: translateY(0);
}

/* ===== Sticky Sidebar Styles ===== */
.category-sidebar,
.filter-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

@media (max-width: 767px) {
    .category-sidebar,
    .filter-sidebar {
        display: none;
    }
}

/* ===== Product Grid Responsive Styles ===== */
@media (min-width: 1440px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 479px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ===== Amazon-style Footer ===== */
.wt-footer {
    background: #ffffff;
    color: #333;
    margin-top: 8px;
    border-top: 1px solid #e5e5e5;
    min-height: 180px;
    content-visibility: auto;
    contain-intrinsic-size: auto 200px;
}
.wt-footer-top {
    background: #fafafa;
    padding: 14px 0;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
}
.wt-footer-top a {
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}
.wt-footer-top a:hover { background: #f0f0f0; }

.wt-footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    justify-items: center;
    text-align: center;
    min-height: 120px;
}
.wt-footer-col h3 {
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-align: center;
}
.wt-footer-col ul { list-style: none; padding: 0; margin: 0; }
.wt-footer-col ul li { margin-bottom: 4px; }
.wt-footer-col ul li a {
    color: #555;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.4;
    text-align: center;
}
.wt-footer-col ul li a:hover { color: #F47A20; text-decoration: underline; }

.wt-footer-divider {
    border-top: 1px solid #e5e5e5;
    padding: 12px 24px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.wt-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.wt-footer-logo img { height: 36px; width: auto; }
.wt-footer-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #555;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 16px;
}
.wt-footer-lang i { font-size: 0.9rem; }

.wt-footer-bottom {
    background: #fafafa;
    padding: 12px 24px;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.wt-footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin-bottom: 8px;
}
.wt-footer-bottom-links a {
    color: #555;
    font-size: 0.72rem;
    text-decoration: none;
    transition: color 0.15s;
}
.wt-footer-bottom-links a:hover { color: #F47A20; text-decoration: underline; }
.wt-footer-copy {
    color: #777;
    font-size: 0.72rem;
}
.wt-footer-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}
.wt-footer-social a {
    color: #555;
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 50%;
    transition: all 0.2s;
}
.wt-footer-social a:hover { color: #F47A20; border-color: #F47A20; }

@media (max-width: 1024px) {
    .wt-footer-main { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
    .wt-footer-main { grid-template-columns: 1fr; gap: 12px; padding: 16px 16px; }
    .wt-footer-col h3 { font-size: 0.9rem; }
    .wt-footer-col ul li a { font-size: 0.78rem; }
    .wt-footer-lang { margin-left: 0; margin-top: 8px; display: flex; }
    .wt-footer-divider { padding: 12px 16px; }
}

/* ===== Desktop search dropdown ===== */
.search-wrap { position: relative; }

@media (min-width: 769px) {
    .search-wrap { overflow: visible; }
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 2000;
    display: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-suggestions.show { display: block; }

@media (max-width: 768px) {
    .search-suggestions { display: none !important; }
}

.search-suggestion-section { padding: 6px 0; }
.search-suggestion-section + .search-suggestion-section { border-top: 1px solid #f0f0f0; }

.search-suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.search-suggestion-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.12s;
}

.search-suggestion-item:hover,
.search-suggestion-item.selected {
    background: #f5f8ff;
}

.search-suggestion-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f3f7;
    flex-shrink: 0;
}

.search-suggestion-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-suggestion-title,
.search-suggestion-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.search-suggestion-category {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.search-suggestion-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ebay-blue);
    flex-shrink: 0;
}

.search-suggestion-was {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 400;
}

.search-suggestion-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: #f1f3f7;
    padding: 2px 8px;
    border-radius: 12px;
}

mark.search-suggestion-highlight {
    background: transparent;
    color: var(--ebay-blue);
    font-weight: 700;
    padding: 0;
}

.search-suggestion-empty {
    padding: 18px 14px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-suggestion-all {
    width: 100%;
    border: none;
    background: #f8fafc;
    padding: 12px 14px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ebay-blue);
    cursor: pointer;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-suggestion-all:hover { background: #f0f7ff; }

/* iOS input zoom fix */
input, textarea, select { font-size: 16px; }
input::placeholder, textarea::placeholder { font-size: 16px; }

.clear-recent {
    border: none;
    background: transparent;
    color: var(--ebay-blue);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
}

.is-skeleton .search-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, #f1f3f7 25%, #e4e7ec 50%, #f1f3f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 4px;
}

.is-skeleton .search-skeleton-img {
    width: 40px;
    height: 40px;
}

.is-skeleton .search-skeleton-line {
    height: 10px;
    width: 140px;
    margin-bottom: 6px;
}

.is-skeleton .search-skeleton-line.short { width: 80px; }

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

/* Desktop: align footer grid columns left-to-right instead of centered */
@media (min-width: 1025px) {
    .wt-footer-main { justify-items: start; text-align: left; }
    .wt-footer-main .wt-footer-col h3 { text-align: left; }
    .wt-footer-main .wt-footer-col ul li a { text-align: left; }
}
