/**
 * VTC Cards Mobile Grid Layout
 * 2x2 grid layout for vtc-cnt-7x9m2-bg-pattern cards on mobile
 */

/* Mobile 2x2 grid for VTC cards */
@media (max-width: 767px) {
    /* Container adjustments */
    .vtc-cnt-7x9m2-bg-pattern .row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        margin: 0 !important;
        padding: 0 10px !important;
    }
    
    /* Reset column classes */
    .vtc-cnt-7x9m2-bg-pattern .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: unset !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Card styling */
    .vtc-cnt-7x9m2-bg-pattern .xb-service,
    .vtc-cnt-7x9m2-bg-pattern .service-item,
    .vtc-cnt-7x9m2-bg-pattern .card,
    .vtc-cnt-7x9m2-bg-pattern .service-box {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        min-height: 180px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 15px !important;
        text-align: center !important;
    }
    
    /* Icon adjustments */
    .vtc-cnt-7x9m2-bg-pattern .xb-item--icon,
    .vtc-cnt-7x9m2-bg-pattern .service-icon,
    .vtc-cnt-7x9m2-bg-pattern .icon {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-item--icon img,
    .vtc-cnt-7x9m2-bg-pattern .service-icon img,
    .vtc-cnt-7x9m2-bg-pattern .icon img {
        width: 40px !important;
        height: 40px !important;
        object-fit: contain !important;
    }
    
    /* Title adjustments */
    .vtc-cnt-7x9m2-bg-pattern .xb-item--title,
    .vtc-cnt-7x9m2-bg-pattern .service-title,
    .vtc-cnt-7x9m2-bg-pattern h3,
    .vtc-cnt-7x9m2-bg-pattern h4 {
        font-size: 14px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        font-weight: 600 !important;
    }
    
    /* Description if exists */
    .vtc-cnt-7x9m2-bg-pattern .xb-item--description,
    .vtc-cnt-7x9m2-bg-pattern .service-desc,
    .vtc-cnt-7x9m2-bg-pattern p {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin-top: 5px !important;
        display: none !important; /* Hide description on mobile for cleaner look */
    }
    
    /* Link styling */
    .vtc-cnt-7x9m2-bg-pattern a.xb-item--link,
    .vtc-cnt-7x9m2-bg-pattern .service-link {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1 !important;
    }
    
    /* Hover effect on mobile */
    .vtc-cnt-7x9m2-bg-pattern .xb-service:active,
    .vtc-cnt-7x9m2-bg-pattern .service-item:active {
        transform: scale(0.98) !important;
        background-color: rgba(0, 0, 0, 0.05) !important;
    }
}

/* Extra small devices - maintain 2x2 but smaller */
@media (max-width: 480px) {
    .vtc-cnt-7x9m2-bg-pattern .row {
        gap: 10px !important;
        padding: 0 5px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-service,
    .vtc-cnt-7x9m2-bg-pattern .service-item {
        min-height: 150px !important;
        padding: 12px 8px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-item--icon,
    .vtc-cnt-7x9m2-bg-pattern .service-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-item--icon img,
    .vtc-cnt-7x9m2-bg-pattern .service-icon img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-item--title,
    .vtc-cnt-7x9m2-bg-pattern .service-title {
        font-size: 13px !important;
    }
}

/* Very small screens - might need single column */
@media (max-width: 360px) {
    .vtc-cnt-7x9m2-bg-pattern .row {
        grid-template-columns: repeat(2, 1fr) !important; /* Still keep 2 columns */
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-service,
    .vtc-cnt-7x9m2-bg-pattern .service-item {
        min-height: 130px !important;
        padding: 10px 5px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-item--title {
        font-size: 12px !important;
    }
}

/* Landscape mode - can show more columns */
@media (max-width: 767px) and (orientation: landscape) {
    .vtc-cnt-7x9m2-bg-pattern .row {
        grid-template-columns: repeat(4, 1fr) !important; /* 4 columns in landscape */
        gap: 12px !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-service,
    .vtc-cnt-7x9m2-bg-pattern .service-item {
        min-height: 140px !important;
    }
}

/* Ensure equal heights */
@media (max-width: 767px) {
    .vtc-cnt-7x9m2-bg-pattern .row {
        align-items: stretch !important;
    }
    
    .vtc-cnt-7x9m2-bg-pattern .xb-service,
    .vtc-cnt-7x9m2-bg-pattern .service-item {
        height: 100% !important;
    }
}

/* Background pattern fix for mobile */
@media (max-width: 767px) {
    .vtc-cnt-7x9m2-bg-pattern {
        background-size: cover !important;
        background-position: center !important;
    }
}

/* Remove any margins that might break the grid */
@media (max-width: 767px) {
    .vtc-cnt-7x9m2-bg-pattern .row > * {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }
}

/* Accessibility improvements */
@media (max-width: 767px) {
    .vtc-cnt-7x9m2-bg-pattern .xb-service:focus-within,
    .vtc-cnt-7x9m2-bg-pattern .service-item:focus-within {
        outline: 2px solid var(--color-primary, #FFC107) !important;
        outline-offset: 2px !important;
    }
}