/* ========================================
   FRONTEND MOBILE RESPONSIVE CSS
   For: Home, About, Contact, Products, Categories
   ======================================== */

/* ===== BASE MOBILE STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* ===== ABOUT PAGE ===== */
@media (max-width: 768px) {
    .about-page .display-4 {
        font-size: 2rem !important;
    }
    
    .about-page .lead {
        font-size: 1rem !important;
    }
    
    .about-page .fs-5 {
        font-size: 1rem !important;
    }
    
    .about-page .card {
        margin-bottom: 1rem !important;
    }
    
    .about-page .card-body {
        padding: 1.5rem !important;
    }
    
    .about-page .card i {
        font-size: 2.5rem !important;
    }
}

/* ===== CONTACT PAGE ===== */
@media (max-width: 768px) {
    .contact-page .display-4 {
        font-size: 2rem !important;
    }
    
    .contact-page .card {
        margin-bottom: 1rem !important;
    }
    
    .contact-page .card-body {
        padding: 1.5rem !important;
    }
    
    .contact-page .card i {
        font-size: 2.5rem !important;
    }
    
    .contact-page .form-control {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
    }
    
    .contact-page textarea.form-control {
        min-height: 120px !important;
    }
    
    .contact-page .btn {
        min-height: 48px !important;
        font-size: 16px !important;
    }
}

/* ===== PRODUCTS PAGE ===== */
@media (max-width: 991px) {
    /* Hide sidebar on mobile */
    .products-sidebar {
        display: none !important;
    }
    
    /* Full width products area */
    .products-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Category icons - horizontal scroll */
    .category-icons-row {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 10px !important;
    }
    
    .category-icons-row .col {
        flex: 0 0 auto !important;
        min-width: 80px !important;
    }
    
    .icon-box {
        padding: 0.75rem !important;
        font-size: 0.7rem !important;
    }
    
    .icon-box i {
        font-size: 1.25rem !important;
    }
    
    /* Product grid - 2 columns on mobile */
    .products-grid .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .product-box {
        margin-bottom: 0.5rem !important;
    }
    
    .product-box .card-body {
        padding: 0.75rem !important;
    }
    
    .product-box h6 {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
}

@media (max-width: 576px) {
    /* Category icons smaller on small mobile */
    .category-icons-row .col {
        min-width: 70px !important;
    }
    
    .icon-box {
        padding: 0.5rem !important;
    }
    
    .icon-box i {
        font-size: 1rem !important;
    }
    
    .icon-box div {
        font-size: 0.65rem !important;
    }
    
    /* Product cards */
    .product-box h6 {
        font-size: 0.75rem !important;
    }
}

/* ===== CATEGORY PAGE ===== */
@media (max-width: 768px) {
    .category-page h1 {
        font-size: 1.75rem !important;
    }
    
    /* Product cards - 2 columns */
    .category-page .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .category-page .card {
        margin-bottom: 0.75rem !important;
    }
    
    .category-page .card-body {
        padding: 1rem !important;
    }
    
    .category-page .card-title {
        font-size: 0.9rem !important;
    }
    
    .category-page .btn {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
    }
    
    /* Blog section */
    .category-page .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ===== PRODUCT DETAIL PAGE ===== */
@media (max-width: 768px) {
    .product-detail .col-md-5,
    .product-detail .col-md-7 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .product-detail img {
        margin-bottom: 1.5rem !important;
    }
    
    .product-detail h1 {
        font-size: 1.5rem !important;
    }
    
    .product-detail .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .product-detail .d-flex.gap-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* ===== BREADCRUMB ===== */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem !important;
        padding: 0.5rem 0 !important;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.25rem !important;
    }
}

/* ===== PAGINATION ===== */
@media (max-width: 768px) {
    .pagination {
        font-size: 0.85rem !important;
        justify-content: center !important;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem !important;
        min-height: 40px !important;
    }
    
    .pagination svg {
        width: 8px !important;
        height: 8px !important;
    }
}

/* ===== CARDS ===== */
@media (max-width: 768px) {
    .card {
        border-radius: 8px !important;
        margin-bottom: 1rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-title {
        font-size: 1.1rem !important;
    }
}

/* ===== BUTTONS ===== */
@media (max-width: 768px) {
    .btn {
        min-height: 44px !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
    
    .btn-lg {
        min-height: 50px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    .btn-sm {
        min-height: 38px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* ===== FORMS ===== */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
    }
    
    textarea.form-control {
        min-height: 120px !important;
    }
    
    .form-label {
        font-size: 14px !important;
        margin-bottom: 0.5rem !important;
    }
}

/* ===== LISTS ===== */
@media (max-width: 768px) {
    .list-unstyled li {
        font-size: 0.9rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .list-group-item {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* ===== SPACING ===== */
@media (max-width: 768px) {
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .g-4 {
        gap: 1rem !important;
    }
}

/* ===== GRID SYSTEM ===== */
@media (max-width: 768px) {
    .row {
        margin-left: -8px !important;
        margin-right: -8px !important;
    }
    
    .row > * {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* ===== IMAGES ===== */
@media (max-width: 768px) {
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ===== MODALS ===== */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-footer {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
    }
}

/* ===== ALERTS ===== */
@media (max-width: 768px) {
    .alert {
        font-size: 0.9rem !important;
        padding: 0.75rem 1rem !important;
    }
}

/* ===== BADGES ===== */
@media (max-width: 768px) {
    .badge {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.65rem !important;
    }
}

/* ===== STICKY SIDEBAR FIX ===== */
@media (max-width: 991px) {
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

/* ===== TOUCH IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    a,
    button,
    .btn,
    .card,
    .list-group-item {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
}

/* ===== SCROLLBAR ===== */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .my-5 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* ===== PRINT ===== */
@media print {
    .btn,
    .breadcrumb,
    .pagination,
    .sticky-top {
        display: none !important;
    }
}
