/* ========================================
   RESPONSIVE FIXES - Home Page
   Fix alignment issues and mobile card layouts
   ======================================== */

/* ========================================
   1. WHY MONEPEX CARDS - 2 CARDS PER ROW ON MOBILE
   ======================================== */

/* Desktop: 4 columns */
.why-moneypex-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 1rem !important;
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .why-moneypex-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.75rem !important;
        max-width: 900px !important;
    }
}

/* Mobile: 2 columns (2 cards per row) */
@media (max-width: 767px) {
    .why-moneypex-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        max-width: 100% !important;
        padding: 0 0.5rem !important;
    }
    
    .why-card {
        padding: 1.5rem 1rem !important;
        min-height: auto !important;
    }
    
    .why-card-icon {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 1rem !important;
    }
    
    .why-card-icon svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .why-card-title {
        font-size: clamp(0.875rem, 3vw, 1rem) !important;
        line-height: 1.3 !important;
    }
}

/* Extra small mobile: Still 2 columns but smaller gap */
@media (max-width: 480px) {
    .why-moneypex-cards {
        gap: 0.75rem !important;
        padding: 0 0.25rem !important;
    }
    
    .why-card {
        padding: 1.25rem 0.75rem !important;
    }
}

/* ========================================
   2. HERO SECTION ALIGNMENT FIXES
   ======================================== */

@media (max-width: 767px) {
    .home-hero-section .hero-row-wrapper {
        align-items: center !important;
        text-align: center !important;
    }
    
    .home-hero-section .hero-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .modern-hero-heading {
        text-align: center !important;
    }
    
    .modern-hero-text {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .hero-button-animate {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .hero-button-animate .btn-premium {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* ========================================
   3. PRODUCTS SECTION ALIGNMENT
   ======================================== */

@media (max-width: 991.98px) {
    .mp-products-section .row {
        flex-direction: column !important;
    }
    
    .mp-products-section .col-lg-7,
    .mp-products-section .col-xl-5,
    .mp-products-section .col-md-12 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .mp-products-list {
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 767px) {
    .mp-products-section {
        padding: 2rem 1rem !important;
    }
    
    .products-section-heading {
        text-align: center !important;
        padding: 0 0.5rem !important;
    }
    
    .products-section-subtitle {
        text-align: center !important;
        padding: 0 0.5rem !important;
    }
}

/* ========================================
   4. CONTAINER ALIGNMENT FIXES
   ======================================== */

.container-fluid.container-md {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 768px) {
    .container-fluid.container-md {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

@media (min-width: 992px) {
    .container-fluid.container-md {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ========================================
   5. SECTION PADDING & SPACING FIXES
   ======================================== */

.why-moneypex-section {
    padding: 4rem 1rem !important;
}

@media (min-width: 768px) {
    .why-moneypex-section {
        padding: 5rem 2rem !important;
    }
}

@media (min-width: 992px) {
    .why-moneypex-section {
        padding: 6rem 3rem !important;
    }
}

/* ========================================
   6. TEXT ALIGNMENT FIXES
   ======================================== */

.why-moneypex-section .text-center {
    text-align: center !important;
    margin: 0 auto !important;
}

.why-moneypex-heading {
    text-align: center !important;
    margin: 0 auto 1rem !important;
}

.why-moneypex-description {
    text-align: center !important;
    margin: 0 auto 1rem !important;
}

.why-moneypex-cta {
    text-align: center !important;
    margin: 0 auto !important;
}

/* ========================================
   7. CARD ALIGNMENT & SPACING
   ======================================== */

.why-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
}

.why-card-title {
    text-align: center !important;
    margin: 0 !important;
    width: 100% !important;
}

/* ========================================
   8. TRUSTED BY SECTION ALIGNMENT
   ======================================== */

@media (max-width: 767px) {
    .trusted-by-section {
        padding: 2rem 1rem !important;
    }
    
    .trusted-by-heading {
        text-align: center !important;
        padding: 0 0.5rem !important;
    }
}

/* ========================================
   9. PRODUCTS LIST ALIGNMENT
   ======================================== */

@media (max-width: 767px) {
    .mp-products-list {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .product-item {
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }
    
    .product-item .d-flex {
        align-items: center !important;
        justify-content: flex-start !important;
    }
}

/* ========================================
   10. GENERAL RESPONSIVE UTILITIES
   ======================================== */

/* Ensure proper text alignment on mobile */
@media (max-width: 767px) {
    .text-center {
        text-align: center !important;
    }
    
    .text-left {
        text-align: left !important;
    }
    
    .text-right {
        text-align: right !important;
    }
}

/* Fix container max-widths */
@media (min-width: 1200px) {
    .container-fluid.container-md {
        max-width: 1400px !important;
    }
}

/* ========================================
   11. FLEXBOX ALIGNMENT FIXES
   ======================================== */

.row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -0.75rem !important;
    margin-right: -0.75rem !important;
}

.row > * {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* ========================================
   12. MOBILE SPECIFIC FIXES
   ======================================== */

@media (max-width: 576px) {
    /* Reduce padding on very small screens */
    .why-moneypex-section {
        padding: 3rem 0.75rem !important;
    }
    
    .why-moneypex-cards {
        gap: 0.5rem !important;
        padding: 0 0.25rem !important;
    }
    
    .why-card {
        padding: 1rem 0.5rem !important;
    }
    
    /* Ensure cards don't overflow */
    .why-card-title {
        font-size: 0.875rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

/* ========================================
   13. TABLET SPECIFIC FIXES
   ======================================== */

@media (min-width: 768px) and (max-width: 991px) {
    .why-moneypex-cards {
        gap: 1.5rem !important;
        padding: 0 1rem !important;
    }
    
    .why-card {
        padding: 2rem 1.5rem !important;
    }
}

/* ========================================
   14. OVERRIDE CONFLICTING STYLES
   ======================================== */

/* Override any 1-column mobile rules */
@media (max-width: 767px) {
    .why-moneypex-cards {
        grid-template-columns: repeat(2, 1fr) !important; /* Force 2 columns */
    }
}

/* Ensure proper alignment */
.why-moneypex-section .container-fluid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.why-moneypex-section .text-center {
    width: 100% !important;
    max-width: 100% !important;
}

/* ========================================
   15. MODAL BACKDROP FIX - MOBILE
   Fix black background when popup is open on mobile
   ======================================== */

/* Modal backdrop - Make it lighter and more transparent on mobile */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important; /* Semi-transparent instead of black */
    backdrop-filter: blur(2px) !important; /* Add subtle blur effect */
}

/* Mobile specific - Even lighter backdrop */
@media (max-width: 767px) {
    .modal-backdrop {
        background-color: rgba(0, 0, 0, 0.4) !important; /* Lighter on mobile */
        backdrop-filter: blur(3px) !important;
    }
    
    /* Ensure backdrop doesn't appear too dark */
    .modal-backdrop.show {
        opacity: 0.4 !important; /* Lighter opacity */
    }
}

/* Extra small mobile - Even lighter */
@media (max-width: 480px) {
    .modal-backdrop {
        background-color: rgba(0, 0, 0, 0.35) !important; /* Even lighter on small screens */
    }
    
    .modal-backdrop.show {
        opacity: 0.35 !important;
    }
}

/* Fix for all modals */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* Ensure modal content is visible above backdrop */
.modal-dialog,
.modal-content {
    z-index: 1055 !important;
    position: relative !important;
}

/* Fix for product modal specifically */
#mpProductsModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

@media (max-width: 767px) {
    #mpProductsModal .modal-backdrop {
        background-color: rgba(0, 0, 0, 0.35) !important;
    }
}

/* Cookie consent modal backdrop */
#cookieConsentModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

@media (max-width: 767px) {
    #cookieConsentModal .modal-backdrop {
        background-color: rgba(0, 0, 0, 0.35) !important;
    }
}

/* ========================================
   16. SELECT-APP PAGE CARD ALIGNMENT FIXES
   Fix card alignment issues on all screen sizes
   ======================================== */

/* Select App Section Container */
.select-app-section {
    padding: 4rem 1rem !important;
}

@media (min-width: 768px) {
    .select-app-section {
        padding: 5rem 2rem !important;
    }
}

@media (min-width: 992px) {
    .select-app-section {
        padding: 6rem 3rem !important;
    }
}

/* App Selection Container */
#app-selection {
    width: 100% !important;
    max-width: 100% !important;
}

#app-selection .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -0.75rem !important;
    margin-right: -0.75rem !important;
    justify-content: center !important;
    align-items: stretch !important;
}

#app-selection .row > [class*="col-"] {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    margin-bottom: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
}

/* App Selection Cards - Ensure Equal Height */
.app-selection-card,
#app-selection .modern-card {
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 2rem 1.5rem !important;
}

/* Card Content Alignment */
.app-selection-card .app-card-icon-wrapper,
#app-selection .modern-card .app-card-icon-wrapper {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 1.5rem !important;
    flex-shrink: 0 !important;
}

.app-selection-card .modern-card-title,
#app-selection .modern-card .modern-card-title {
    width: 100% !important;
    text-align: center !important;
    margin: 0 0 1rem 0 !important;
    flex-shrink: 0 !important;
}

.app-selection-card .modern-card-text,
#app-selection .modern-card .modern-card-text {
    width: 100% !important;
    text-align: center !important;
    margin: 0 0 1.5rem 0 !important;
    flex-grow: 1 !important;
    display: flex !important;
    align-items: flex-start !important;
}

.app-selection-card .btn-premium,
#app-selection .modern-card .btn-premium {
    width: 100% !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* Desktop: 4 columns */
@media (min-width: 992px) {
    #app-selection .col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .app-selection-card {
        padding: 2.5rem 2rem !important;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    #app-selection .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .app-selection-card {
        padding: 2rem 1.5rem !important;
    }
}

/* Mobile: 2 columns */
@media (max-width: 767px) {
    #app-selection .col-md-6,
    #app-selection .col-lg-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .app-selection-card {
        padding: 1.5rem 1rem !important;
    }
    
    .app-selection-card .app-card-icon-wrapper {
        margin-bottom: 1rem !important;
    }
    
    .app-selection-card .modern-card-title {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .app-selection-card .modern-card-text {
        font-size: 0.875rem !important;
        margin-bottom: 1rem !important;
    }
}

/* Extra Small Mobile: 1 column */
@media (max-width: 576px) {
    #app-selection .col-md-6,
    #app-selection .col-lg-3 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .app-selection-card {
        padding: 1.5rem 1rem !important;
    }
}

/* Fix inconsistent margins */
.app-selection-card .modern-card-title.mt-4 {
    margin-top: 0 !important;
}

.app-selection-card .modern-card-title.mb-3 {
    margin-bottom: 1rem !important;
}

.app-selection-card .modern-card-text.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Ensure all cards have same structure */
.app-selection-card > * {
    width: 100% !important;
}

/* Icon wrapper consistency */
.app-card-icon {
    width: 4rem !important;
    height: 4rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 1rem !important;
}

.app-icon-svg {
    width: 2rem !important;
    height: 2rem !important;
}

/* Button alignment */
.app-selection-card .btn-premium {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Container alignment */
.select-app-section .container-fluid.container-md {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 768px) {
    .select-app-section .container-fluid.container-md {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

@media (min-width: 992px) {
    .select-app-section .container-fluid.container-md {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

/* ========================================
   17. INDUSTRIES WE SERVE CAROUSEL FIXES
   Fix carousel functionality and mobile view
   ======================================== */

/* Carousel Container */
.features-carousel-section {
    padding: 4rem 1rem !important;
    overflow: hidden !important;
}

@media (min-width: 768px) {
    .features-carousel-section {
        padding: 5rem 2rem !important;
    }
}

@media (min-width: 992px) {
    .features-carousel-section {
        padding: 6rem 3rem !important;
    }
}

.features-carousel-section .container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 768px) {
    .features-carousel-section .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Carousel Wrapper */
.products-carousel-wrapper {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
    margin-top: 2rem !important;
}

.products-carousel {
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.products-carousel-track {
    display: flex !important;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform !important;
    width: 100% !important;
}

/* Card Base Styles */
.products-carousel-track .product-card {
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding: 0 0.75rem !important;
}

/* Desktop: 4 columns */
@media (min-width: 1280px) {
    .products-carousel-track .product-card {
        flex: 0 0 25% !important;
        padding: 0 0.75rem !important;
    }
}

/* Tablet Large: 3 columns */
@media (min-width: 1024px) and (max-width: 1279px) {
    .products-carousel-track .product-card {
        flex: 0 0 33.333% !important;
        padding: 0 0.75rem !important;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-carousel-track .product-card {
        flex: 0 0 50% !important;
        padding: 0 0.5rem !important;
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .products-carousel-track .product-card {
        flex: 0 0 100% !important;
        padding: 0 0.5rem !important;
    }
    
    .features-carousel-section {
        padding: 3rem 0.75rem !important;
    }
    
    .features-carousel-section .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Industry Card Styles */
.industry-card {
    height: 100% !important;
    margin-bottom: 0 !important;
}

.industry-card-inner {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 2rem 1.5rem !important;
}

@media (max-width: 767px) {
    .industry-card-inner {
        padding: 1.5rem 1.25rem !important;
    }
}

/* Industry Icon Wrapper */
.industry-icon-wrapper {
    width: 3.5rem !important;
    height: 3.5rem !important;
    margin-bottom: 1.25rem !important;
}

@media (max-width: 767px) {
    .industry-icon-wrapper {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 1rem !important;
    }
    
    .industry-icon-wrapper svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* Industry Card Title */
.industry-card-title {
    font-size: clamp(1.125rem, 2vw, 1.375rem) !important;
    margin-bottom: 0.875rem !important;
    line-height: 1.3 !important;
}

@media (max-width: 767px) {
    .industry-card-title {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* Industry Card Description */
.industry-card-description {
    font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
    flex: 1 !important;
}

@media (max-width: 767px) {
    .industry-card-description {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.25rem !important;
    }
}

/* Industry Card Link */
.industry-card-link {
    font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
    margin-top: auto !important;
}

@media (max-width: 767px) {
    .industry-card-link {
        font-size: 0.875rem !important;
    }
}

/* Pagination Dots */
.carousel-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 2rem !important;
    flex-wrap: wrap !important;
}

@media (max-width: 767px) {
    .carousel-pagination {
        margin-top: 1.5rem !important;
        gap: 0.375rem !important;
    }
}

.pagination-dot {
    width: 0.5rem !important;
    height: 0.5rem !important;
    border-radius: 9999px !important;
    background-color: #d1d5db !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
}

.pagination-dot.active {
    width: 2rem !important;
    background-color: #1E5CAA !important;
}

@media (max-width: 767px) {
    .pagination-dot.active {
        width: 1.5rem !important;
    }
}

.pagination-dot:hover {
    background-color: #9ca3af !important;
}

.pagination-dot.active:hover {
    background-color: #174a85 !important;
}

/* Heading Styles */
.features-carousel-heading {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

.features-carousel-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem) !important;
    color: #64748b !important;
    text-align: center !important;
    margin-bottom: 0 !important;
}

@media (max-width: 767px) {
    .features-carousel-heading {
        font-size: 1.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .features-carousel-subtitle {
        font-size: 1rem !important;
    }
}

