/**
 * Enhanced Styles for Category Display and Contact Form
 * Theme: Dai Cat Loi 2023
 */

/* =================================================================
   Homepage Category Display Improvements
   ================================================================= */

/* Category Grid Section */
.shop-banner {
    position: relative;
    padding: 60px 0;
}

.shop-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(34, 140, 34, 0.85) 0%, rgba(5, 25, 34, 0.75) 100%);
    z-index: 1;
}

.shop-banner .container {
    position: relative;
    z-index: 2;
}

.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}

.category-item {
    position: relative;
    height: 130px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 3px solid rgba(34, 140, 34, 0.3);
    border-radius: 12px !important;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin: 0 !important;
    width: 100% !important;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #228C22 0%, #1a6b1a 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.category-item:hover::before {
    transform: scaleX(1);
}

.category-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(34, 140, 34, 0.3);
    border-color: #228C22;
    background: rgba(255, 255, 255, 1) !important;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1 !important;
    padding: 15px;
    background: transparent;
}

.category-name {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-name i {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
    color: #228C22;
    transition: all 0.3s ease;
}

.category-item:hover .category-name i {
    transform: scale(1.15);
    color: #1a6b1a;
}

.category-name p {
    color: #051922 !important;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    text-shadow: none !important;
    transition: all 0.3s ease;
}

.category-item:hover .category-name p {
    color: #228C22 !important;
    transform: scale(1.05);
}

/* =================================================================
   Floating Action Buttons Enhancement
   ================================================================= */

.floating-action-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fab-icon {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 65px !important;
    height: 65px !important;
    background-color: #fff !important;
    background-size: 40px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid rgba(34, 140, 34, 0.2);
}

.fab-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 80px;
    background: rgba(5, 25, 34, 0.95);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fab-icon:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 30px rgba(34, 140, 34, 0.4), 0 0 0 6px rgba(34, 140, 34, 0.1);
    border-color: #228C22;
}

.fab-icon:hover::after {
    opacity: 1;
    transform: translateX(0);
}

#zalo-fab::after {
    content: 'Chat Zalo';
}

#whatsapp-fab::after {
    content: 'WhatsApp';
}

#wechat-fab::after {
    content: 'WeChat';
}

/* =================================================================
   Archive Product Page - Category Filter Improvements
   ================================================================= */

.product-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.product-filters h3 {
    color: #228C22;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid transparent;
}

.filter-checkbox:hover {
    background: #e9ecef;
    border-color: #228C22;
    transform: translateX(5px);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #228C22;
    cursor: pointer;
}

.filter-checkbox span {
    font-size: 14px;
    color: #051922;
    font-weight: 500;
}

.filter-checkbox input[type="checkbox"]:checked + span {
    color: #228C22;
    font-weight: 600;
}

/* Category Grid on Archive Page */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.category-card {
    background: linear-gradient(135deg, #228C22 0%, #1a6b1a 100%);
    color: white;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 140, 34, 0.2);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

.category-card:hover::before {
    transform: scale(1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(34, 140, 34, 0.4);
}

.category-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.category-card .count {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

/* =================================================================
   Pagination Improvements
   ================================================================= */

.pagination-wrapper {
    margin-top: 40px;
}

.pagination .page-item .page-link {
    color: #228C22;
    border: 2px solid #e9ecef;
    margin: 0 3px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: #228C22;
    border-color: #228C22;
    color: white;
}

.pagination .page-item .page-link:hover {
    background: #228C22;
    border-color: #228C22;
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
    background: transparent;
    color: #8a8f8a;
    border-color: transparent;
    pointer-events: none;
}

/* =================================================================
   Responsive Adjustments
   ================================================================= */

@media (max-width: 992px) {
    .categories-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .category-item {
        height: 120px !important;
    }
    
    .category-name i {
        font-size: 28px;
    }
    
    .category-name p {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .categories-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 12px;
    }
    
    .category-item {
        height: 115px !important;
    }
    
    .category-name i {
        font-size: 26px;
        margin-bottom: 6px;
    }
    
    .category-name p {
        font-size: 13px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    .category-card h3 {
        font-size: 14px;
    }
    
    .filter-checkbox {
        font-size: 13px;
    }
    
    .floating-action-button {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .fab-icon {
        width: 55px !important;
        height: 55px !important;
        background-size: 35px !important;
    }
    
    .fab-icon::after {
        display: none; /* Hide tooltips on mobile */
    }
}

@media (max-width: 576px) {
    .categories-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .category-item {
        height: 105px !important;
    }
    
    .category-name i {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .category-name p {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
