/* ===============================================
   PROFESSIONAL CATEGORY BAR SYSTEM V7
   - เพิ่ม icon สำหรับแต่ละหมวดหมู่
   - ออกแบบให้เป็นมืออาชีพ
   - ช่องว่างกับ Hero Slider เพียง 0.5px
   =============================================== */

/* Main Section Container - ช่องว่างขั้นต่ำ */
.category-section {
    padding: 16px clamp(18px, 5%, 36px) !important;
    margin: 0 auto !important;
    width: 100%;
    position: relative;
    overflow: visible;
    background: transparent;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box;
}

/* Contained Background - พื้นหลังสีฟ้าใน container */
.category-section-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 25px;
    position: relative;
    box-sizing: border-box;
    
    /* พื้นหลังแบบ gradient มืออาชีพ */
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    
    /* เพิ่ม subtle pattern overlay */
    position: relative;
}

.category-section-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Navigation Grid - กระจายเฉลี่ยเต็มพื้นที่ */
.category-navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 25px;
    width: 100%;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Professional Category Button Styling */
.category-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 500;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    min-height: 80px;
    position: relative;
    overflow: hidden;
    line-height: 1.3;
}

/* Icon Container */
.category-nav-link .category-icon {
    font-size: 24px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    display: block;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin: 0 auto 8px auto;
}

/* Text Label */
.category-nav-link .category-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Professional Hover Effects */
.category-nav-link:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.category-nav-link:hover .category-icon {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.category-nav-link:hover .category-text {
    font-weight: 600;
}

/* Active State */
.category-nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-nav-link.active .category-icon {
    background: rgba(255, 255, 255, 0.3);
}

/* Shimmer Effect for Professional Look */
.category-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
    z-index: 1;
}

.category-nav-link:hover::before {
    left: 100%;
}

.category-nav-link * {
    position: relative;
    z-index: 2;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Desktop Large (>1400px) */
@media (min-width: 1401px) {
    .category-section {
        margin-top: 0.75rem; /* ระยะห่างมากขึ้นสำหรับหน้าจอใหญ่ */
    }
    
    .category-section-wrapper {
        max-width: 1400px;
    }
    
    .category-navigation-grid {
        padding: 30px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .category-nav-link {
        padding: 22px 18px;
        min-height: 90px;
    }
    
    .category-nav-link .category-icon {
        font-size: 28px;
        width: 36px;
        height: 36px;
        margin-bottom: 10px;
    }
    
    .category-nav-link .category-text {
        font-size: 14px;
    }
}

/* Desktop Medium (1200px - 1400px) */
@media (max-width: 1400px) and (min-width: 1201px) {
    .category-section {
        margin-top: 0.6rem; /* ระยะห่างปานกลางสำหรับหน้าจอกลาง */
    }
    
    .category-section-wrapper {
        max-width: 1200px;
    }
    
    .category-navigation-grid {
        padding: 28px;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 14px;
    }
    
    .category-nav-link {
        padding: 20px 16px;
        min-height: 85px;
    }
    
    .category-nav-link .category-icon {
        font-size: 26px;
        width: 34px;
        height: 34px;
    }
}

/* Desktop Small (992px - 1200px) */
@media (max-width: 1200px) and (min-width: 993px) {
    .category-section {
        margin-top: 0.5rem; /* ระยะห่างมาตรฐาน */
    }
    
    .category-section-wrapper {
        max-width: 992px;
    }
    
    .category-navigation-grid {
        padding: 25px;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .category-nav-link {
        padding: 18px 14px;
        min-height: 80px;
    }
    
    .category-nav-link .category-icon {
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
}

/* Tablet (768px - 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .category-section {
        margin-top: 0.4rem; /* ระยะห่างน้อยลงสำหรับ tablet */
    }
    
    .category-section-wrapper {
        max-width: 768px;
    }
    
    .category-navigation-grid {
        padding: 22px;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .category-nav-link {
        padding: 16px 12px;
        min-height: 75px;
    }
    
    .category-nav-link .category-icon {
        font-size: 22px;
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
    }
    
    .category-nav-link .category-text {
        font-size: 12px;
    }
}

/* Mobile Large (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .category-section {
        margin-top: 0.3rem; /* ระยะห่างน้อยสำหรับ mobile large */
    }
    
    .category-navigation-grid {
        padding: 20px;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
    }
    
    .category-nav-link {
        padding: 14px 10px;
        min-height: 70px;
    }
    
    .category-nav-link .category-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
        margin-bottom: 5px;
    }
    
    .category-nav-link .category-text {
        font-size: 11px;
    }
}

/* Mobile Small (≤480px) */
@media (max-width: 480px) {
    .category-section {
        margin-top: 0.25rem; /* ระยะห่างน้อยที่สุดสำหรับ mobile small */
    }
    
    .category-navigation-grid {
        padding: 18px;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 6px;
    }
    
    .category-nav-link {
        padding: 12px 8px;
        min-height: 65px;
        border-radius: 10px;
    }
    
    .category-nav-link .category-icon {
        font-size: 18px;
        width: 26px;
        height: 26px;
        margin-bottom: 4px;
    }
    
    .category-nav-link .category-text {
        font-size: 10px;
    }
}

/* ===============================================
   ACCESSIBILITY & ANIMATION
   =============================================== */

/* Focus States */
.category-nav-link:focus {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .category-nav-link {
        transition: none;
    }
    
    .category-nav-link:hover {
        transform: none;
    }
    
    .category-nav-link .category-icon {
        transition: none;
    }
    
    .category-nav-link::before {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .category-nav-link {
        border-color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.25);
    }
    
    .category-nav-link:hover {
        border-color: white;
        background: rgba(255, 255, 255, 0.35);
    }
    
    .category-nav-link .category-icon {
        background: rgba(255, 255, 255, 0.3);
    }
} 