/**
 * GI Category Icons Block - Modern Design
 * Redesigned for modern, clean, responsive, and accessible UI
 * 
 * @package Grabit
 * @version 2.0
 */

/* ========================================
   MODERN CATEGORY ICONS - REDESIGNED
   ======================================== */

/* Container Styling */
.gi-category-block-wrapper {
    position: relative;
    overflow: hidden;
}

/* Section Wrapper */
.gi-category {
    position: relative;
    width: 100%;
}

/* Static Grid Layout - Responsive */
.gi-category-grid-static.flex,
.gi-category-block.flex {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 !important;
    width: 100%;
}

/* Force disable carousel movement */
.gi-category-grid-static .carousel-track,
.gi-category-grid-static.vanilla-carousel .carousel-track {
    transform: translate3d(0, 0, 0) !important;
    transition: none !important;
    display: contents !important;
    position: static !important;
    width: auto !important;
}

.gi-category-grid-static,
.gi-category-grid-static.vanilla-carousel {
    overflow: visible !important;
}

/* Disable autoplay */
.gi-category-grid-static.vanilla-carousel {
    pointer-events: auto !important;
}

/* Make all category items visible */
.gi-category-grid-static .gi-cat-box {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Responsive Grid Breakpoints */
@media (min-width: 576px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 992px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.75rem;
    }
}

@media (min-width: 1200px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1400px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* ========================================
   CARD LAYOUT - MODERN DESIGN
   ======================================== */

/* Card Container */
.gi-category .gi-cat-box {
    padding: 0 !important;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card Content Wrapper - Now an <a> tag */
.gi-category .gi-cat-icon {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 
                0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease,
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    min-height: 100%;
}

/* ========================================
   ICON/IMAGE SECTION
   ======================================== */

/* Category Image */
.gi-category .gi-cat-icon .gi-cat-image {
    width: 100% !important;
    height: clamp(140px, 20vw, 200px) !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease !important;
}

/* Icon Fallback (when no image) */
.gi-category .gi-cat-icon > i {
    width: 100% !important;
    height: clamp(140px, 20vw, 200px) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: clamp(3rem, 5vw, 4rem) !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #495057 !important;
    line-height: 1 !important;
    transition: transform 0.3s ease, background 0.3s ease !important;
    text-align: center !important;
}

/* Picture Element Support */
.gi-category .gi-cat-icon picture {
    width: 100%;
    display: block;
}

.gi-category .gi-cat-icon picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   CONTENT SECTION - MODERN DESIGN
   ======================================== */

/* Content Detail Panel */
.gi-category .gi-cat-detail {
    width: 100% !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    padding: 1.25rem 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center !important;
    margin-top: auto !important;
    flex-grow: 1 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    min-height: auto !important;
}

/* Remove the "ΔΕΙΤΕ ΤΑ ΟΛΑ" pseudo-element for cleaner design */
.gi-category .gi-cat-detail a::after {
    display: none;
}

/* Category Title */
.gi-category .gi-cat-title {
    font-size: clamp(0.9375rem, 1.2vw, 1.125rem) !important;
    line-height: 1.4 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    font-weight: 600 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    overflow: hidden !important;
    text-transform: capitalize !important;
    letter-spacing: -0.01em !important;
}

/* Product Count */
.gi-category .gi-cat-detail .items {
    margin: 0 !important;
    font-size: 0.8125rem !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.gi-category .gi-cat-detail .items span {
    color: #aa1c1c !important;
    font-weight: 600 !important;
}

/* ========================================
   BADGE STYLING
   ======================================== */

.gi-category .gi-lbl {
    background: #aa1c1c !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(170, 28, 28, 0.2);
}

/* ========================================
   HOVER & INTERACTIVE STATES
   ======================================== */

/* Card Hover Effect */
.gi-category .gi-cat-box:hover .gi-cat-icon,
.gi-category .gi-cat-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 
                0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Image/Icon Hover Animation */
.gi-category .gi-cat-box:hover .gi-cat-image,
.gi-category .gi-cat-box:hover .gi-cat-icon > i {
    transform: scale(1.05);
}

/* Link Hover - Entire card */
.gi-category .gi-cat-icon:hover .gi-cat-title {
    color: #aa1c1c !important;
}

/* ========================================
   ACCESSIBILITY - FOCUS STATES
   ======================================== */

/* Keyboard Focus - Entire Card Link */
.gi-category .gi-cat-icon:focus-visible {
    outline: 2px solid #aa1c1c;
    outline-offset: 3px;
    border-radius: 0.75rem;
}

.gi-category .gi-cat-box:focus-within .gi-cat-icon {
    outline: 2px solid #aa1c1c;
    outline-offset: 3px;
    border-radius: 0.75rem;
}

/* Ensure focus is visible */
.gi-category .gi-cat-icon:focus-visible .gi-cat-title {
    color: #aa1c1c !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .gi-category .gi-cat-icon {
        border: 2px solid #000000;
    }
    
    .gi-category .gi-cat-box:focus-within {
        outline: 3px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .gi-category .gi-cat-box,
    .gi-category .gi-cat-icon,
    .gi-category .gi-cat-image,
    .gi-category .gi-cat-icon > i {
        transition: none !important;
    }
    
    .gi-category .gi-cat-box:hover .gi-cat-icon,
    .gi-category .gi-cat-icon:hover {
        transform: none;
    }
    
    .gi-category .gi-cat-box:hover .gi-cat-image,
    .gi-category .gi-cat-box:hover .gi-cat-icon > i,
    .gi-category .gi-cat-icon:hover .gi-cat-image,
    .gi-category .gi-cat-icon:hover > i {
        transform: none;
    }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Tablet */
@media (max-width: 991px) {
    .gi-category .gi-cat-detail {
        padding: 1rem 0.875rem;
    }
    
    .gi-category .gi-cat-icon .gi-cat-image,
    .gi-category .gi-cat-icon > i {
        height: clamp(120px, 25vw, 180px);
    }
    
    .gi-category .gi-cat-title {
        font-size: 0.9375rem !important;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        gap: 0.875rem;
    }
    
    .gi-category .gi-cat-detail {
        padding: 1rem 0.75rem;
    }
    
    .gi-category .gi-cat-title {
        font-size: 0.875rem !important;
    }
    
    .gi-category .gi-cat-detail .items {
        font-size: 0.75rem;
    }
    
    .gi-category .gi-cat-icon .gi-cat-image,
    .gi-category .gi-cat-icon > i {
        height: clamp(100px, 30vw, 160px);
    }
    
    .gi-category .gi-cat-icon > i {
        font-size: 2.5rem;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    .gi-category-grid-static.flex,
    .gi-category-block.flex {
        gap: 0.75rem;
    }
    
    .gi-category .gi-cat-detail {
        padding: 0.875rem 0.625rem !important;
    }
}

/* ========================================
   FORCE OVERRIDE - HIGHEST SPECIFICITY
   ======================================== */

/* Ensure white background overrides any other styles */
.gi-category .gi-cat-box .gi-cat-icon .gi-cat-detail,
.gi-category-block-wrapper .gi-category .gi-cat-detail,
.gi-category .gi-cat-detail {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #1a1a1a !important;
}

.gi-category .gi-cat-box .gi-cat-icon .gi-cat-detail .gi-cat-title,
.gi-category .gi-cat-detail .gi-cat-title,
.gi-category .gi-cat-title {
    color: #1a1a1a !important;
}

.gi-category .gi-cat-box .gi-cat-icon .gi-cat-detail .items,
.gi-category .gi-cat-detail .items {
    color: #6b7280 !important;
}
