/* ========================================
   COMPREHENSIVE RESPONSIVE STYLES
   A1 Global Traders Website
   ======================================== */

/* Base responsive utilities */
.img-responsive {
    max-width: 100%;
    height: auto;
}

/* ========================================
   MOBILE FIRST - EXTRA SMALL DEVICES
   (Portrait phones, less than 576px)
   ======================================== */
@media (max-width: 575.98px) {
    /* Typography */
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    h1, .h1 { font-size: 1.6rem !important; }
    h2, .h2 { font-size: 1.4rem !important; }
    h3, .h3 { font-size: 1.2rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }
    h5, .h5 { font-size: 0.95rem !important; }
    h6, .h6 { font-size: 0.85rem !important; }
    p { font-size: 0.85rem; }
    
    /* Container adjustments */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .px-xl-5 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Navbar responsive */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .mobile-nav-logo {
        height: 45px !important;
        width: auto;
    }
    
    /* Category banner */
    .position-relative.overflow-hidden {
        height: 150px !important;
        margin-bottom: 1rem;
    }
    
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    /* Product grid - 2 columns on mobile */
    .col-lg-4.col-md-6.col-sm-6.pb-1 {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 5px;
        padding-right: 5px;
        margin-bottom: 10px;
    }
    
    /* Glass cards mobile optimization */
    .glass-card {
        margin-bottom: 15px !important;
        border-radius: 10px;
    }
    
    .glass-card .card-img {
        height: 140px;
    }
    
    .glass-card .card-body {
        padding: 10px;
    }
    
    .glass-card .card-title {
        font-size: 0.85rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }
    
    /* Category items mobile */
    .cat-item {
        margin-bottom: 10px;
        padding: 8px;
    }
    
    .cat-item .overflow-hidden {
        width: 70px !important;
        height: 70px !important;
    }
    
    .cat-item h5 {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .section-title span {
        padding: 5px 15px !important;
        font-size: 1rem;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Footer responsive */
    .footer .col-md-4,
    .footer .col-md-6 {
        margin-bottom: 1.5rem;
    }
    
    .footer h5,
    .footer h6 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .footer p,
    .footer a {
        font-size: 0.85rem;
    }
    
    /* Contact form */
    .contact-form .form-control {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .contact-form .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* Vision mission section */
    .vision-mission-section {
        padding: 30px 15px;
    }
    
    .vision,
    .mission {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .vision h3,
    .mission h3 {
        font-size: 1.2rem;
    }
    
    .vision p,
    .mission p {
        font-size: 0.85rem;
    }
    
    /* Proprietor section */
    .proprietor-section .overflow-hidden {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 15px;
    }
    
    .proprietor-section h3 {
        font-size: 1.1rem !important;
    }
    
    .proprietor-section h5 {
        font-size: 0.9rem !important;
    }
    
    .proprietor-section p {
        font-size: 0.8rem !important;
        line-height: 1.3;
    }
    
    /* Carousel adjustments */
    .carousel-item {
        height: 250px !important;
    }
    
    .carousel-caption h1 {
        font-size: 1.5rem !important;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Product offers */
    .product-offer {
        height: 120px !important;
        margin-bottom: 15px;
    }
    
    /* Back to top button */
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: 15px;
    }
    
    /* Hide elements on mobile */
    .d-none-mobile {
        display: none !important;
    }
}

/* ========================================
   SMALL DEVICES (Landscape phones, 576px and up)
   ======================================== */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Typography adjustments */
    body {
        font-size: 15px;
    }
    
    h1, .h1 { font-size: 1.8rem !important; }
    h2, .h2 { font-size: 1.6rem !important; }
    
    /* Product grid - 3 columns */
    .col-lg-4.col-md-6.col-sm-6.pb-1 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .glass-card .card-img {
        height: 160px;
    }
    
    /* Category items */
    .cat-item .overflow-hidden {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Carousel */
    .carousel-item {
        height: 300px !important;
    }
    
    .product-offer {
        height: 140px !important;
    }
}

/* ========================================
   MEDIUM DEVICES (Tablets, 768px and up)
   ======================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Container adjustments */
    .px-xl-5 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Product grid - 3 columns */
    .col-lg-4.col-md-6.col-sm-6.pb-1 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .glass-card .card-img {
        height: 200px;
    }
    
    /* Category items */
    .cat-item .overflow-hidden {
        width: 90px !important;
        height: 90px !important;
    }
    
    /* Carousel */
    .carousel-item {
        height: 350px !important;
    }
    
    .product-offer {
        height: 160px !important;
    }
    
    /* Vision mission responsive */
    .vision-mission-box {
        gap: 20px;
    }
    
    .vision,
    .mission {
        flex: 1 1 100%;
        margin-bottom: 20px;
    }
}

/* ========================================
   LARGE DEVICES (Desktops, 992px and up)
   ======================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Product grid - 3 columns */
    .col-lg-4.col-md-6.col-sm-6.pb-1 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .glass-card .card-img {
        height: 220px;
    }
}

/* ========================================
   EXTRA LARGE DEVICES (Large desktops, 1200px and up)
   ======================================== */
@media (min-width: 1200px) {
    /* Standard desktop layout */
    .col-lg-4.col-md-6.col-sm-6.pb-1 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .glass-card .card-img {
        height: 250px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION FIXES
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .carousel-item {
        height: 200px !important;
    }
    
    .product-offer {
        height: 90px !important;
    }
    
    .navbar {
        padding: 0.25rem 1rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar,
    .mobile-menu,
    .back-to-top,
    .carousel-indicators,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container-fluid {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card {
        border: 2px solid #000;
        background: #fff;
    }
    
    .cat-item {
        border: 1px solid #000;
    }
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
   ======================================== */
.text-responsive {
    font-size: calc(0.8rem + 0.5vw);
}

.padding-responsive {
    padding: calc(0.5rem + 1vw);
}

.margin-responsive {
    margin: calc(0.25rem + 0.5vw);
}

/* Responsive spacing utilities */
@media (max-width: 575.98px) {
    .p-mobile-1 { padding: 0.5rem !important; }
    .p-mobile-2 { padding: 1rem !important; }
    .m-mobile-1 { margin: 0.5rem !important; }
    .m-mobile-2 { margin: 1rem !important; }
    
    .px-mobile-1 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .py-mobile-1 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
}

/* Responsive text alignment */
.text-center-mobile {
    text-align: center;
}

@media (min-width: 768px) {
    .text-center-mobile {
        text-align: left;
    }
}

/* Responsive display utilities */
@media (max-width: 575.98px) {
    .d-mobile-none { display: none !important; }
    .d-mobile-block { display: block !important; }
    .d-mobile-flex { display: flex !important; }
}

@media (min-width: 576px) {
    .d-sm-up-none { display: none !important; }
    .d-sm-up-block { display: block !important; }
    .d-sm-up-flex { display: flex !important; }
}