/* suppliers-critical.css - Extreme optimization with Mobile Bottom Buttons & 6-Column Grid */
/* FIXED: NO HORIZONTAL SCROLL - Optimized for 740px and below */

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

/* PREVENT HORIZONTAL SCROLL ON ALL DEVICES - CRITICAL FIX */
html, body {
    max-width:100%;
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
}

/* ============================================
   MAIN SUPPLIER STYLES
   ============================================ */
.container-supplier {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden !important;
}

.supplier-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px 20px;
    overflow-x: hidden !important;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 15px;
    padding: 8px 0;
    font-size: 12px;
    display: none;
    background: transparent;
}

.breadcrumb a {
    color: #e67e22;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 8px;
    display: none;
}

.page-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ============================================
   SUPPLIER GRID - 6 COLUMNS ON DESKTOP
   ============================================ */
.supplier-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 25px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Supplier Card */
.supplier-card {
    display: block;
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    height: 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e0e0;
}

.supplier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #e67e22;
}

/* Supplier Banner */
.supplier-banner {
    position: relative;
    width: 100%;
    height: 110px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    overflow: hidden;
}

.supplier-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supplier-banner.default-banner {
    background: linear-gradient(135deg, #e67e22, #d35400);
    display: flex;
    align-items: center;
    justify-content: center;
}

.supplier-banner.default-banner i {
    font-size: 42px;
    color: rgba(255, 255, 255, 0.3);
}

/* Supplier Logo */
.supplier-logo-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: -40px;
    margin-bottom: 10px;
    z-index: 2;
}

.supplier-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.supplier-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Supplier Info */
.supplier-info {
    padding: 0 12px 12px;
    text-align: center;
    overflow-x: hidden;
}

.supplier-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.supplier-name:hover {
    color: #e67e22;
}

.supplier-address {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.supplier-address i {
    font-size: 10px;
    color: #e67e22;
}

.contact-person {
    font-size: 10px;
    color: #95a5a6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

/* Product Badge */
.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e67e22;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    margin-top: 6px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    margin: 25px 0;
    border: 1px solid #e0e0e0;
}

/* Supplier Footer */
.supplier-footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
}

/* Hero - Hidden */
.hero {
    display: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS - OPTIMIZED FOR 740px AND BELOW
   ============================================ */

/* Devices 740px and below - MAIN FIX ZONE */
@media (max-width: 740px) {
    /* Force no horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    .container-supplier,
    .supplier-content,
    .supplier-grid {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .supplier-content {
        padding: 17px 12px;
    }
    
    .supplier-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin: 15px 0;
    }
    
    .supplier-banner {
        height: 85px;
    }
    
    .supplier-logo {
        width: 60px;
        height: 60px;
        margin-top: -30px;
    }
    
    .supplier-name {
        font-size: 12px;
        
    }
    
    .supplier-address {
        font-size: 10px;
    }
    
    .contact-person {
        font-size: 9px;
    }
}

/* Devices 640px and below */
@media (max-width: 640px) {
    .supplier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .supplier-content {
        padding: 10px 10px;
    }
    
    .supplier-banner {
        height: 80px;
    }
    
    .supplier-logo {
        width: 55px;
        height: 55px;
        margin-top: -27px;
    }
    
    .supplier-name {
        font-size: 12px;
    }
}

/* Devices 540px and below */
@media (max-width: 540px) {
    .supplier-grid {
        gap: 10px;
    }
    
    .supplier-content {
        padding: 8px 8px;
    }
    
    .supplier-banner {
        height: 75px;
    }
    
    .supplier-logo {
        width: 50px;
        height: 50px;
        margin-top: -25px;
    }
    
    .supplier-info {
        padding: 0 8px 10px;
    }
    
    .supplier-name {
        font-size: 11px;
    }
    
    .supplier-address {
        font-size: 9px;
    }
    
    .contact-person {
        font-size: 8px;
    }
    
    .product-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
}

/* Devices 480px and below */
@media (max-width: 480px) {
    .supplier-grid {
        gap: 10px;
    }
    
    .supplier-banner {
        height: 70px;
    }
    
    .supplier-logo {
        width: 48px;
        height: 48px;
        margin-top: -24px;
    }
    
    .supplier-name {
        font-size: 10px;
    }
}

/* Devices 400px and below */
@media (max-width: 400px) {
    .supplier-grid {
        gap: 8px;
    }
    
    .supplier-content {
        padding: 6px 6px;
    }
    
    .supplier-banner {
        height: 65px;
    }
    
    .supplier-logo {
        width: 45px;
        height: 45px;
        margin-top: -22px;
    }
    
    .supplier-info {
        padding: 0 6px 8px;
    }
    
    .supplier-name {
        font-size: 10px;
    }
    
    .supplier-address {
        font-size: 8px;
        gap: 3px;
    }
    
    .contact-person {
        font-size: 8px;
        margin-top: 6px;
        padding-top: 6px;
    }
    
    .product-badge {
        font-size: 7px;
        padding: 1px 4px;
    }
}

/* Devices 320px and below */
@media (max-width: 320px) {
    .supplier-grid {
        gap: 6px;
    }
    
    .supplier-content {
        padding: 5px 5px;
    }
    
    .supplier-banner {
        height: 55px;
    }
    
    .supplier-logo {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }
    
    .supplier-name {
        font-size: 9px;
    }
    
    .supplier-address {
        font-size: 7px;
    }
    
    .contact-person {
        font-size: 7px;
    }
}

/* ============================================
   LANDSCAPE MODE FIX
   ============================================ */
@media (max-width: 740px) and (orientation: landscape) {
    .supplier-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .supplier-banner {
        height: 65px;
    }
    
    .supplier-logo {
        width: 50px;
        height: 50px;
        margin-top: -25px;
    }
    
    .mobile-bottom-nav {
        padding: 4px 12px;
    }
    
    .mobile-nav-item {
        padding: 4px 8px;
    }
    
    .mobile-nav-item i {
        font-size: 18px;
    }
    
    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* ============================================
   DESKTOP BREAKPOINTS (Above 740px)
   ============================================ */
@media (min-width: 741px) and (max-width: 992px) {
    .supplier-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .supplier-content {
        padding: 12px 15px;
    }
    
    .supplier-banner {
        height: 95px;
    }
    
    .supplier-logo {
        width: 70px;
        height: 70px;
        margin-top: -35px;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .supplier-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1201px) {
    .supplier-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .supplier-card:hover {
        transform: none;
    }
    
    .supplier-card:active {
        transform: scale(0.98);
        background: #fafafa;
    }
    
    .mobile-nav-item {
        min-height: 44px;
    }
    
    .mobile-nav-item:active {
        background: #f5f5f5;
        color: #e67e22;
    }
}

/* ============================================
   STRICT PREVENTION - NO HORIZONTAL SCROLL
   ============================================ */
@media (max-width: 740px) {
    /* Force NO horizontal scroll on all elements */
    * {
        max-width: 100%;
    }
    
    body, 
    html, 
    .container-supplier,
    .supplier-content,
    .supplier-grid,
    [class*="grid"],
    .row,
    [class*="col-"],
    .supplier-card,
    .supplier-info {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Ensure all images are responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Prevent card overflow */
    .supplier-card {
        min-width: 0;
        width: 100%;
    }
    
    /* Text handling for overflow */
    .supplier-name,
    .breadcrumb li,
    .supplier-address span {
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    
    /* Remove any margin that might cause overflow */
    .supplier-grid {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #d35400;
    transform: translateY(-3px);
}

@media (max-width: 740px) {
    .scroll-top {
        bottom: 75px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* Loading State */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #e67e22;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.supplier-card {
    animation: fadeIn 0.3s ease;
}