/* ═══════════════════════════════════════════════════════════════════════════ */
/*  products.css  —  Chaungeni Technologies Shop                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --primary:         #2563eb;
    --primary-dark:    #1d4ed8;
    --dark:            #1e293b;
    --corporate-blue:  #1e3a8a;
    --corporate-gray:  #374151;
    --success:         #10b981;
    --warning:         #f59e0b;
    --danger:          #ef4444;
    --border:          #e5e7eb;
    --bg-light:        #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark);
    background: #ffffff;
    overflow-x: hidden;
}

/* Navbar (unchanged) */
.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-brand {
    font-weight: 700;
    color: var(--corporate-blue) !important;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-brand img { height: 35px; }
.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    margin: 0 4px;
    padding: 8px 14px !important;
    position: relative;
    transition: color 0.25s ease;
}
.nav-link:hover { color: var(--primary) !important; }
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 70%; }
.nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}
.category-dropdown .btn-outline-dark {
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 6px 14px;
    transition: all 0.2s;
}
.category-dropdown .btn-outline-dark:hover {
    background: var(--dark);
    color: white;
}
.category-dropdown .dropdown-menu {
    width: 280px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
    border-radius: 10px;
    padding: 10px 0;
}
.category-dropdown .dropdown-item {
    padding: 9px 18px;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}
.category-dropdown .dropdown-item i {
    width: 22px;
    color: var(--primary);
}
.category-dropdown .dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 22px;
}
.corporate-btn-primary {
    background: linear-gradient(135deg, var(--corporate-blue), #3b82f6);
    border: none;
    padding: 9px 18px;
    font-weight: 600;
    border-radius: 8px;
    color: white !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.corporate-btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.nav-link .badge {
    font-size: 0.62rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cart-link    { position: relative; }
.cart-badge   {
    position: absolute;
    top: 0; right: -8px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px; height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px 0;
    min-width: 220px;
}
.dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}
.dropdown-item i {
    width: 24px;
    margin-right: 10px;
    color: var(--primary);
}
.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 25px;
}

/* Main layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
    padding-top: 20px;
}
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transition: all 0.3s;
    cursor: pointer;
}
.sidebar-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Filters sidebar */
.filters-sidebar {
    width: 280px;
    min-width: 280px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    height: fit-content;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}
.filters-sidebar::-webkit-scrollbar         { width: 5px; }
.filters-sidebar::-webkit-scrollbar-track   { background: #f1f1f1; }
.filters-sidebar::-webkit-scrollbar-thumb   { background: var(--primary); border-radius: 3px; }
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.filter-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.close-sidebar {
    background: none;
    border: none;
    color: var(--corporate-gray);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: none;
}
.close-sidebar:hover {
    background: var(--bg-light);
    color: var(--danger);
}
.filter-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.filter-section:last-child { border-bottom: none; }
.filter-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.filter-title .toggle-icon {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s;
    color: var(--corporate-gray);
}
.filter-content.collapsed { display: none; }
.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.3;
}
.filter-option input[type="checkbox"] {
    margin-right: 9px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.filter-count {
    color: #94a3b8;
    font-size: 0.78rem;
    margin-left: 3px;
}
.filter-search-box {
    position: relative;
    margin-bottom: 20px;
}
.filter-search-box input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.filter-search-box input:focus { border-color: var(--primary); }
.filter-search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--corporate-gray);
    pointer-events: none;
}
.price-slider { margin-top: 14px; }
.price-range {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.price-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.83rem;
    color: var(--corporate-gray);
    font-weight: 500;
}
.clear-filters-btn {
    width: 100%;
    background: var(--danger);
    color: white;
    border: none;
    padding: 11px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 4px;
}
.clear-filters-btn:hover { background: #dc2626; }

/* Products area */
.products-container {
    flex: 1;
    padding: 0 24px 60px;
    min-width: 0;
}
.controls-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}
.search-box {
    flex: 1;
    position: relative;
    min-width: 240px;
}
.search-box input {
    width: 100%;
    padding: 11px 50px 11px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--primary); }
.search-box button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.search-box button:hover { background: var(--primary-dark); }
.sort-box select {
    padding: 11px 36px 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    min-width: 190px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23737474' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 18px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.sort-box select:focus { border-color: var(--primary); }
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.92rem;
    color: var(--corporate-gray);
}
.results-count strong { color: var(--dark); font-weight: 700; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.filter-tag button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    margin-left: 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.filter-tag button:hover { opacity: 1; }
.active-filter-tag {
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}
.active-filter-tag button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Loading, error & empty states */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--corporate-gray);
}
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 0;
    color: var(--danger);
    text-align: center;
}
.error-state i          { font-size: 3rem; margin-bottom: 16px; }
.error-state h3         { font-size: 1.3rem; margin-bottom: 8px; }
.error-state p          { color: var(--corporate-gray); font-size: 0.95rem; }
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 18px;
    cursor: pointer;
    transition: background 0.2s;
}
.retry-btn:hover { background: var(--primary-dark); }
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--corporate-gray);
    text-align: center;
}
.empty-state i  { font-size: 4rem; margin-bottom: 20px; color: var(--primary); }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; }

/* Product cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}
.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
    border-color: var(--primary);
}
.ct-unavailable { opacity: 0.72; }
.ct-card-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}
.ct-hot-badge, .ct-featured-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: white;
    text-align: center;
}
.ct-hot-badge      { background: #ef4444; }
.ct-featured-badge { background: var(--corporate-blue); }
.product-image-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    position: relative;
    padding: 15px;
    overflow: hidden;
}
.product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}
.product-card:hover .product-image { transform: scale(1.06); }
.stock-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.in-stock  { background: var(--success); color: white; }
.low-stock { background: var(--warning); color: white; }
.out-stock { background: var(--danger);  color: white; }
.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-brand {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--corporate-blue);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}
.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--dark);
}
.product-sku {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}
.ct-spec-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.ct-spec-pill {
    background: #f1f5f9;
    color: var(--corporate-gray);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.product-price {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 12px;
    margin-top: auto;
    padding-top: 6px;
}
.product-actions { display: flex; justify-content: stretch; margin-top: 4px; }
.btn-add-cart {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.btn-add-cart:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.ct-btn-disabled, .btn-add-cart:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 40px;
    gap: 6px;
}
.page-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 7px;
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}
.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 700;
}
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.page-ellipsis {
    padding: 8px 4px;
    color: #94a3b8;
    font-size: 0.9rem;
    user-select: none;
}

/* Product detail modal */
.modal-body { overflow-x: hidden; word-wrap: break-word; }
.modal-main-image-wrap {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-main-image {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.modal-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.modal-thumbnails::-webkit-scrollbar { height: 5px; }
.modal-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.modal-thumb {
    width: 60px;
    height: 50px;
    object-fit: contain;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    background: #f8fafc;
    transition: border-color 0.2s;
}
.modal-thumb:hover, .modal-thumb.active { border-color: var(--primary); }
.modal-body table { width: 100%; table-layout: fixed; word-wrap: break-word; }
.modal-body td, .modal-body th { padding: 6px 8px; font-size: 0.85rem; }

/* Responsive */
@media (min-width: 1600px) { .products-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1599px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1199px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .products-container { padding: 0 18px 40px; }
}
@media (max-width: 991px) {
    .sidebar-toggle-btn { display: flex; }
    .close-sidebar { display: block; }
    .main-container { flex-direction: column; }
    .filters-sidebar {
        width: 300px;
        position: fixed;
        left: 0;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 1000;
        transform: translateX(-100%);
        border-right: 1px solid var(--border);
        border-bottom: none;
        background: white;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    }
    .filters-sidebar.open, .filters-sidebar.visible { transform: translateX(0); }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .controls-bar { flex-direction: column; padding: 0 0 10px; }
    .sort-box select { min-width: unset; width: 100%; }
}
@media (max-width: 767px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .products-container { padding: 0 12px 40px; }
    .results-info { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 575px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-image-container { height: 140px; }
    .product-info  { padding: 11px; }
    .product-name  { font-size: 0.88rem; }
    .product-price { font-size: 1.05rem; }
}
@media (max-width: 992px) {
    .product-overview-container { grid-template-columns: 1fr; gap: 24px; }
    .product-main-image { max-height: 340px; }
    .product-quick-actions { flex-direction: column; }
    .suggested-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .product-overview-price { font-size: 1.8rem; }
    .quantity-selector { width: 100%; }
    .product-hero-image-wrapper { max-height: 300px; }
}
@media print {
    .navbar, .filters-sidebar, .controls-bar, .pagination, .btn-add-cart,
    .modal-backdrop, .modal-header .btn-close, .sidebar-toggle-btn {
        display: none !important;
    }
    .products-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .product-card { page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  ADVANCED SEARCH SUGGESTIONS  (v4)                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ct-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
    overflow: hidden;
    animation: ct-sug-in 0.15s ease;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.ct-suggestions::-webkit-scrollbar { width: 5px; }
.ct-suggestions::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

@keyframes ct-sug-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Group headers */
.ct-sug-group-header {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.ct-sug-group-header:first-child { border-top: none; }

/* Suggestion items — shared */
.ct-suggestion-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--dark);
}
.ct-suggestion-item:hover,
.ct-suggestion-item.active { background: #eff6ff; }

/* Product item */
.ct-sug-product {
    padding: 8px 14px;
}
.ct-sug-img-wrap {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}
.ct-sug-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ct-sug-text { flex: 1; min-width: 0; }
.ct-sug-name {
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ct-sug-name strong { color: var(--primary); }
.ct-sug-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}
.ct-sug-brand {
    font-size: 0.74rem;
    color: var(--corporate-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ct-sug-price {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}
.ct-sug-arrow {
    color: #cbd5e1;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.ct-suggestion-item:hover .ct-sug-arrow { color: var(--primary); transform: translateX(2px); }

/* Brand + category items */
.ct-sug-brand-item,
.ct-sug-category-item {
    padding: 8px 16px;
    gap: 10px;
    font-size: 0.88rem;
}
.ct-sug-icon {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.ct-sug-brand-item strong,
.ct-sug-category-item strong { color: var(--primary); }
.ct-sug-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* "Did you mean?" */
.ct-sug-dym {
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #64748b;
}
.ct-sug-dym-word {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

/* Footer "search all" */
.ct-sug-footer {
    padding: 10px 16px;
    font-size: 0.84rem;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.ct-sug-footer:hover { background: #eff6ff; color: var(--primary); }
.ct-sug-footer strong { color: var(--dark); }
.ct-sug-footer i { color: #94a3b8; font-size: 0.78rem; }


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  RECOMMENDED PRODUCTS (v4 — enhanced)                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ct-rec-heading {
    font-weight: 700;
    margin-bottom: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}
.ct-rec-heading i { color: var(--primary); }

.ct-rec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .ct-rec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .ct-rec-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

.ct-rec-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.ct-rec-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(37,99,235,0.13);
    transform: translateY(-2px);
}
.ct-rec-card--loading { pointer-events: none; }

.ct-rec-img-wrap {
    height: 110px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 8px;
}
.ct-rec-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.ct-rec-card:hover .ct-rec-img-wrap img { transform: scale(1.06); }

/* Stock badge on rec card */
.ct-rec-stock {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ct-rec-stock.out { background: #fee2e2; color: #dc2626; }
.ct-rec-stock.low { background: #fef3c7; color: #d97706; }

.ct-rec-info {
    padding: 9px 10px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ct-rec-brand {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--corporate-blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}
.ct-rec-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.ct-rec-price {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 5px;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  SKELETON  (shared)                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

@keyframes ct-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.ct-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 600px 100%;
    animation: ct-shimmer 1.4s infinite linear;
    border-radius: 6px;
}
.ct-skel-img    { height: 180px; border-radius: 0; }
.ct-skel-brand  { height: 10px; width: 50%; margin-bottom: 6px; }
.ct-skel-name   { height: 14px; width: 85%; margin-bottom: 5px; }
.ct-skel-short  { width: 55%; }
.ct-skel-price  { height: 18px; width: 40%; margin: 8px 0; }
.ct-skel-btn    { height: 36px; margin-top: 8px; border-radius: 8px; }


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  PRODUCT CARD  badges                                                        */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ct-card-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.ct-hot-badge {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 3px;
}
.ct-featured-badge {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Share Modal — Product Preview Card ─────────────────────────────────── */
.ct-share-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
}
.ct-share-preview img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.ct-share-preview-info {
    flex: 1;
    min-width: 0;
}
.ct-share-preview-brand {
    font-size: .72rem;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
}
.ct-share-preview-name {
    font-size: .88rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ct-share-preview-price {
    font-size: .95rem;
    font-weight: 800;
    color: #2563eb;
    margin-top: 5px;
}

/* Hint text below the preview */
.ct-share-hint {
    font-size: .78rem;
    color: #64748b;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    line-height: 1.5;
}
.ct-share-hint i {
    color: #2563eb;
    margin-top: 2px;
    flex-shrink: 0;
}