/**
 * Mobile Responsive Styles - 1wayworld E-Commerce Platform
 * Feature: 026-mobile-responsive
 * Created: 2026-01-09
 *
 * This file contains mobile-first responsive overrides for the platform.
 * Breakpoints:
 *   - 320px: Small phones (iPhone SE, etc.)
 *   - 576px: Large phones (Bootstrap sm)
 *   - 768px: Tablets (Bootstrap md)
 *   - 992px: Desktop (Bootstrap lg)
 *
 * Performance targets:
 *   - FCP < 2s on 3G
 *   - TTI < 4s on 3G
 */

/* ==========================================================================
   Phase 2: Foundational - Base Mobile Utilities
   ========================================================================== */

/* T005: Base mobile breakpoint structure */
@media (max-width: 767.98px) {
    /* Mobile-specific base styles */
    html {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }
}

@media (max-width: 575.98px) {
    /* Small phone specific styles */
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Large phone / small tablet styles */
}

/* T006: Touch target utility classes */
.touch-target-44 {
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 767.98px) {
    .btn,
    .nav-link,
    .form-control,
    select,
    input[type="checkbox"] + label,
    input[type="radio"] + label,
    .dropdown-item,
    .list-group-item-action {
        min-height: 44px;
    }

    /* Ensure adequate spacing between tap targets */
    .btn + .btn {
        margin-left: 8px;
    }

    [dir="rtl"] .btn + .btn {
        margin-left: 0;
        margin-right: 8px;
    }
}

/* T007: Mobile typography utilities */
@media (max-width: 767.98px) {
    body {
        font-size: 16px;
        line-height: 1.5;
    }

    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.125rem; }
    h5, .h5 { font-size: 1rem; }
    h6, .h6 { font-size: 0.875rem; }

    p, .text-body {
        font-size: 1rem;
        line-height: 1.6;
    }

    small, .small {
        font-size: 0.875rem;
    }
}

/* T008: Prevent horizontal scroll utility */
@media (max-width: 767.98px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .container,
    .container-fluid,
    .row {
        max-width: 100%;
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    table {
        max-width: 100%;
    }

    pre, code {
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* T009: Mobile-friendly button and link styles */
@media (max-width: 767.98px) {
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        padding: 8px 16px;
        font-size: 0.875rem;
        min-height: 36px;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 1.125rem;
        min-height: 48px;
    }

    /* Full-width buttons on mobile */
    .btn-mobile-block {
        display: block;
        width: 100%;
    }

    /* Links with better tap area */
    a:not(.btn) {
        padding: 4px 0;
    }

    /* Card action buttons */
    .card .btn,
    .card-footer .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .card-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   Phase 3: User Story 1 - Product Browsing
   ========================================================================== */

/* T010: Product grid responsive layout */
@media (max-width: 575.98px) {
    /* Single column on small phones - DO NOT affect owl-carousel */
    .product-grid,
    .view-page-product-grid,
    .__best-selling {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-single-hover,
    .product-card,
    .flash-deal-product,
    .__inline-27 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Two columns on large phones */
    .product-grid,
    .flash_deal_product,
    .view-page-product-grid,
    .__best-selling {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-single-hover,
    .product-card,
    .flash-deal-product {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* T011: Product card mobile styles */
@media (max-width: 767.98px) {
    .product-single-hover,
    .product-card {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .product-single-hover img,
    .product-card img,
    .product-card .img-fit {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .product-card .card-body,
    .product-single-hover .product-details {
        padding: 12px;
    }

    .product-card .product-title,
    .product-single-hover .product-title {
        font-size: 0.9375rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card .product-price,
    .product-single-hover .product-price {
        font-size: 1rem;
        font-weight: 700;
    }

    /* Wishlist/Compare buttons on mobile */
    .product-card .product-actions,
    .product-single-hover .product-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px;
    }

    .product-card .product-actions .btn,
    .product-single-hover .product-actions .btn {
        flex: 1;
        padding: 8px;
        font-size: 0.875rem;
    }
}

/* T013: Mobile filter panel styles */
@media (max-width: 767.98px) {
    .filter-sidebar,
    .search-product-filter,
    #collapseFilter {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 1060;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 16px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    }

    .filter-sidebar.show,
    .search-product-filter.show,
    #collapseFilter.show {
        left: 0;
    }

    [dir="rtl"] .filter-sidebar,
    [dir="rtl"] .search-product-filter,
    [dir="rtl"] #collapseFilter {
        left: auto;
        right: -100%;
    }

    [dir="rtl"] .filter-sidebar.show,
    [dir="rtl"] .search-product-filter.show,
    [dir="rtl"] #collapseFilter.show {
        right: 0;
    }

    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1055;
        display: none;
    }

    .filter-overlay.show {
        display: block;
    }

    .filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        margin-bottom: 16px;
        border-bottom: 1px solid #eee;
    }

    .filter-close-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 8px;
        min-height: 44px;
        min-width: 44px;
    }

    /* Mobile filter toggle button */
    .mobile-filter-btn {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        background: var(--web-primary, #f27a1a);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    .mobile-filter-btn i {
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .mobile-filter-btn {
        display: none !important;
    }
}

/* T015: CSS scroll-snap for product image gallery */
@media (max-width: 767.98px) {
    .product-gallery,
    .product-image-slider,
    .gallery-container,
    .tns-outer {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        scrollbar-width: none;
    }

    .product-gallery::-webkit-scrollbar,
    .product-image-slider::-webkit-scrollbar,
    .gallery-container::-webkit-scrollbar {
        display: none;
    }

    .product-gallery img,
    .product-gallery .gallery-item,
    .product-image-slider .slide-item,
    .tns-item {
        flex: 0 0 100%;
        scroll-snap-align: start;
        width: 100%;
        height: auto;
    }

    /* Gallery dots indicator */
    .gallery-dots,
    .tns-nav {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
        padding: 8px 0;
    }

    .gallery-dots .dot,
    .tns-nav button {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ddd;
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background 0.2s;
    }

    .gallery-dots .dot.active,
    .tns-nav button.tns-nav-active {
        background: var(--web-primary, #f27a1a);
        width: 24px;
        border-radius: 4px;
    }
}

/* T017: Mobile search interface styles */
@media (max-width: 767.98px) {
    .search-form-wrapper,
    .search-box,
    #search-box {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 1070;
        padding: 12px 16px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .search-form-wrapper.open,
    .search-box.open,
    #search-box.show {
        transform: translateY(0);
    }

    .search-form-wrapper .form-control,
    .search-box input,
    #search-box input {
        width: 100%;
        height: 48px;
        font-size: 16px;
        padding: 12px 48px 12px 16px;
        border-radius: 24px;
        border: 1px solid #ddd;
    }

    .search-form-wrapper .search-btn,
    .search-box .search-submit {
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        padding: 12px;
        min-height: 44px;
        min-width: 44px;
    }

    [dir="rtl"] .search-form-wrapper .search-btn,
    [dir="rtl"] .search-box .search-submit {
        right: auto;
        left: 24px;
    }

    .search-close-btn {
        position: absolute;
        left: 24px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        padding: 12px;
        min-height: 44px;
        min-width: 44px;
        font-size: 1.25rem;
    }

    [dir="rtl"] .search-close-btn {
        left: auto;
        right: 24px;
    }

    /* Search suggestions */
    .search-suggestions,
    .search-result-box,
    #search-suggestions {
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        max-height: 60vh;
        overflow-y: auto;
    }

    .search-suggestions .suggestion-item,
    .search-result-box a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #f5f5f5;
        min-height: 44px;
    }

    .search-suggestions .suggestion-item:active,
    .search-result-box a:active {
        background: #f5f5f5;
    }
}

/* T019: Touch-friendly Add to Cart button */
@media (max-width: 767.98px) {
    .add-to-cart-btn,
    .btn-add-to-cart,
    .add-to-cart,
    [data-action="add-to-cart"],
    .product-details .btn-primary {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 12px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .product-details .btn-group,
    .product-details .action-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .product-details .btn-group .btn,
    .product-details .action-buttons .btn {
        width: 100%;
    }

    /* Quantity controls */
    .quantity-selector,
    .qty-container {
        display: flex;
        align-items: center;
        gap: 0;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }

    .quantity-selector .qty-btn,
    .qty-container button {
        min-width: 44px;
        min-height: 44px;
        border: none;
        background: #f5f5f5;
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quantity-selector input,
    .qty-container input {
        width: 60px;
        text-align: center;
        border: none;
        font-size: 1rem;
        min-height: 44px;
    }
}

/* ==========================================================================
   Phase 4: User Story 2 - Checkout
   ========================================================================== */

/* T022: Cart page mobile styles */
@media (max-width: 767.98px) {
    .cart-item,
    .cart-product,
    .shop_cart-wrap {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        background: #fff;
        border-radius: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .cart-item-image,
    .cart-product-image {
        width: 100%;
        max-width: 120px;
        border-radius: 8px;
        overflow: hidden;
    }

    .cart-item-image img,
    .cart-product-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .cart-item-details {
        flex: 1;
    }

    .cart-item-title {
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 8px;
    }

    .cart-item-price {
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--web-primary, #f27a1a);
    }

    .cart-item-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }

    .cart-remove-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
        color: #dc3545;
        background: #fff0f0;
        border-radius: 8px;
    }

    /* Cart summary */
    .cart-summary,
    .cart-total-wrapper {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 16px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        margin: 0 -15px;
        border-radius: 16px 16px 0 0;
    }

    .cart-summary .btn-checkout,
    .checkout-btn {
        width: 100%;
        min-height: 52px;
        font-size: 1.125rem;
    }
}

/* T024: Checkout form mobile styles */
@media (max-width: 767.98px) {
    .checkout-form,
    .checkout-details-form,
    #checkout-form {
        padding: 0;
    }

    .checkout-form .form-group,
    .checkout-details-form .form-group {
        margin-bottom: 16px;
    }

    .checkout-form .form-control,
    .checkout-details-form .form-control,
    .checkout-form input,
    .checkout-form select,
    .checkout-form textarea {
        width: 100%;
        min-height: 48px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px 16px;
        border-radius: 10px;
        border: 1px solid #ddd;
        background: #fff;
    }

    .checkout-form .form-control:focus,
    .checkout-details-form .form-control:focus {
        border-color: var(--web-primary, #f27a1a);
        box-shadow: 0 0 0 3px rgba(242, 122, 26, 0.15);
    }

    .checkout-form label {
        font-size: 0.9375rem;
        font-weight: 500;
        margin-bottom: 6px;
        display: block;
    }

    /* Two column layout for city/zip */
    .checkout-form .row-cols-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .checkout-form .row-cols-2 .form-group {
        margin-bottom: 0;
    }
}

/* T026: Mobile step indicator */
@media (max-width: 767.98px) {
    .checkout-steps,
    .step-indicator,
    .checkout-progress {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 16px 0;
        margin-bottom: 24px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .checkout-steps::-webkit-scrollbar {
        display: none;
    }

    .checkout-step,
    .step-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        flex: 0 0 auto;
        min-width: 80px;
    }

    .checkout-step .step-number,
    .step-item .step-circle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #e0e0e0;
        color: #666;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        font-weight: 600;
    }

    .checkout-step.active .step-number,
    .step-item.active .step-circle {
        background: var(--web-primary, #f27a1a);
        color: #fff;
    }

    .checkout-step.completed .step-number,
    .step-item.completed .step-circle {
        background: #28a745;
        color: #fff;
    }

    .checkout-step .step-label,
    .step-item .step-text {
        font-size: 0.75rem;
        color: #666;
        text-align: center;
    }

    .checkout-step.active .step-label,
    .step-item.active .step-text {
        color: var(--web-primary, #f27a1a);
        font-weight: 500;
    }
}

/* T027: Payment method card styles */
@media (max-width: 767.98px) {
    .payment-methods,
    .payment-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .payment-method,
    .payment-option {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: #fff;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s;
        min-height: 64px;
    }

    .payment-method:active,
    .payment-option:active {
        background: #f9f9f9;
    }

    .payment-method.selected,
    .payment-option.selected,
    .payment-method input:checked + label,
    .payment-option input:checked ~ * {
        border-color: var(--web-primary, #f27a1a);
        background: rgba(242, 122, 26, 0.05);
    }

    .payment-method-icon,
    .payment-option img {
        width: 48px;
        height: 32px;
        object-fit: contain;
    }

    .payment-method-name {
        font-size: 1rem;
        font-weight: 500;
        flex: 1;
    }

    .payment-method input[type="radio"] {
        width: 20px;
        height: 20px;
        accent-color: var(--web-primary, #f27a1a);
    }
}

/* T029: Order confirmation mobile styles */
@media (max-width: 767.98px) {
    .order-confirmation,
    .order-success {
        text-align: center;
        padding: 32px 16px;
    }

    .order-confirmation .success-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 24px;
        background: #28a745;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 2.5rem;
    }

    .order-confirmation h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .order-confirmation .order-number {
        font-size: 1.125rem;
        color: #666;
        margin-bottom: 24px;
    }

    .order-details-summary {
        background: #f9f9f9;
        border-radius: 12px;
        padding: 16px;
        text-align: left;
        margin-bottom: 24px;
    }

    .order-details-summary .row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .order-details-summary .row:last-child {
        border-bottom: none;
        font-weight: 600;
    }

    .order-confirmation .btn-continue {
        width: 100%;
        min-height: 52px;
        font-size: 1.125rem;
    }
}

/* T030: Mobile validation error styles */
@media (max-width: 767.98px) {
    .invalid-feedback,
    .form-error,
    .error-message {
        display: block;
        font-size: 0.8125rem;
        color: #dc3545;
        margin-top: 6px;
        padding-left: 4px;
    }

    .form-control.is-invalid,
    .form-control.error,
    input.is-invalid {
        border-color: #dc3545;
        background-image: none;
    }

    .form-control.is-invalid:focus,
    .form-control.error:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    }

    /* Shake animation for errors */
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    .form-group.has-error .form-control {
        animation: shake 0.3s ease;
    }
}

/* ==========================================================================
   Phase 5: User Story 3 - Navigation
   ========================================================================== */

/* T034: Mobile navigation drawer */
@media (max-width: 767.98px) {
    .mobile-nav-drawer,
    #mobile-nav-drawer {
        display: none;
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        z-index: 1080;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }

    .mobile-nav-drawer.open,
    #mobile-nav-drawer.open {
        display: block;
        left: 0;
    }

    /* T039: RTL support for drawer */
    [dir="rtl"] .mobile-nav-drawer,
    [dir="rtl"] #mobile-nav-drawer {
        left: auto;
        right: -100%;
    }

    [dir="rtl"] .mobile-nav-drawer.open,
    [dir="rtl"] #mobile-nav-drawer.open {
        right: 0;
        left: auto;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #eee;
        background: #f9f9f9;
    }

    .mobile-nav-logo {
        max-height: 36px;
        width: auto;
    }

    .mobile-nav-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        padding: 8px;
        min-height: 44px;
        min-width: 44px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-content {
        padding: 16px;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        color: #333;
        text-decoration: none;
        font-size: 1rem;
        border-bottom: 1px solid #f0f0f0;
        min-height: 52px;
    }

    .mobile-nav-item:active {
        background: #f5f5f5;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
        margin-right: 12px;
        width: 24px;
        text-align: center;
    }

    [dir="rtl"] .mobile-nav-item i {
        margin-right: 0;
        margin-left: 12px;
    }

    .mobile-nav-item .arrow {
        font-size: 0.75rem;
        transition: transform 0.2s;
    }

    .mobile-nav-item.expanded .arrow {
        transform: rotate(90deg);
    }

    [dir="rtl"] .mobile-nav-item.expanded .arrow {
        transform: rotate(-90deg);
    }
}

/* T035: Drawer overlay */
@media (max-width: 767.98px) {
    .mobile-nav-overlay,
    #mobile-nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1075;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-nav-overlay.open,
    #mobile-nav-overlay.open {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}

/* T036: Expandable categories */
@media (max-width: 767.98px) {
    .mobile-nav-submenu {
        display: none;
        background: #f9f9f9;
        padding-left: 0;
        margin: 0;
        list-style: none;
    }

    .mobile-nav-item.expanded + .mobile-nav-submenu,
    .mobile-nav-submenu.open {
        display: block;
    }

    .mobile-nav-submenu .mobile-nav-item {
        padding-left: 48px;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    [dir="rtl"] .mobile-nav-submenu .mobile-nav-item {
        padding-left: 16px;
        padding-right: 48px;
    }

    .mobile-nav-submenu .mobile-nav-submenu .mobile-nav-item {
        padding-left: 64px;
        font-size: 0.875rem;
    }

    [dir="rtl"] .mobile-nav-submenu .mobile-nav-submenu .mobile-nav-item {
        padding-left: 16px;
        padding-right: 64px;
    }
}

/* T037: Mobile header styles - ENHANCED for better UX */
@media (max-width: 767.98px) {
    /* ========================================
       TOPBAR - Compact on Mobile
       ======================================== */
    .topbar {
        padding: 4px 0 !important;
        font-size: 12px;
    }

    .topbar .container {
        padding: 0 12px;
    }

    .topbar-link {
        font-size: 11px !important;
        padding: 2px 4px !important;
    }

    .topbar-text.dropdown {
        margin: 0 4px !important;
    }

    /* Hide currency selector on very small screens */
    @media (max-width: 400px) {
        .topbar-text.dropdown.disable-autohide.mr-4 {
            display: none !important;
        }
    }

    /* ========================================
       MAIN HEADER - Optimized Layout
       ======================================== */
    .navbar-sticky {
        padding: 0 !important;
    }

    .navbar-sticky .navbar {
        padding: 8px 0 !important;
        min-height: auto !important;
    }

    .navbar-sticky .container {
        padding: 0 12px !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Logo - Very Compact (to maximize search space) */
    .navbar-brand,
    .ty-brand-logo {
        margin: 0 !important;
        margin-right: 8px !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        max-width: 40px !important;
        min-width: auto !important;
    }

    .ty-logo-container {
        gap: 0 !important;
    }

    .ty-logo-img {
        height: 32px !important;
        width: auto !important;
        max-width: 40px !important;
        object-fit: contain !important;
    }

    .ty-brand-text {
        display: none !important;
    }

    /* Remove min-width constraint on logo */
    .__min-w-7rem {
        min-width: auto !important;
    }

    /* ========================================
       SEARCH BAR - MAXIMIZED FOR MOBILE
       Hamburger removed, search takes most of the header space
       ======================================== */
    /* Override the hidden transform from style.css */
    .search-form-mobile,
    .search-form-mobile:not(.active),
    .ty-search-container {
        position: static !important;
        transform: none !important;
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 4px !important;
        max-width: none !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        z-index: auto !important;
    }

    /* Search form wrapper - full width */
    .ty-search-form,
    .search_form {
        width: 100% !important;
        flex: 1 !important;
    }

    /* Search Wrapper - Container for input - LARGER */
    .ty-search-wrapper {
        border-radius: 8px !important;
        border: 2px solid #e0e0e0 !important;
        background: #f8f8f8 !important;
        height: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .ty-search-wrapper:focus-within {
        background: #fff !important;
        border-color: var(--web-primary, #f27a1a) !important;
        box-shadow: 0 0 0 2px rgba(242, 122, 26, 0.2) !important;
    }

    .ty-search-icon-wrapper {
        padding: 0 10px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        background: transparent !important;
    }

    .ty-search-icon,
    .czi-search {
        font-size: 18px !important;
        color: #888 !important;
    }

    /* SEARCH INPUT - LARGE AND FULLY VISIBLE */
    /* Using high specificity selectors to override trendyol-product-card.css and customer-modern.css */
    .ty-search-container .ty-search-input,
    .ty-search-container input.ty-search-input,
    .search-form-mobile .ty-search-input,
    input[type="search"].ty-search-input,
    .ty-search-wrapper .ty-search-input,
    .ty-search-wrapper input.ty-search-input,
    .ty-search-wrapper input[type="search"],
    .ty-search-input,
    .search-bar-input {
        padding: 8px 12px 8px 0 !important;
        font-size: 16px !important;  /* 16px prevents iOS zoom on focus */
        height: 40px !important;
        min-height: 40px !important;
        line-height: 24px !important;
        color: #222 !important;
        background-color: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        outline: none !important;
        width: 100% !important;
        flex: 1 1 auto !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        -webkit-text-fill-color: #222 !important;
        opacity: 1 !important;
        font-weight: 400 !important;
        caret-color: #f27a1a !important;
    }

    .ty-search-container .ty-search-input::placeholder,
    .ty-search-wrapper .ty-search-input::placeholder,
    .ty-search-input::placeholder,
    .search-bar-input::placeholder {
        font-size: 14px !important;
        color: #999 !important;
        opacity: 1 !important;
        -webkit-text-fill-color: #999 !important;
    }

    /* Ensure typed text is visible */
    .ty-search-container .ty-search-input:focus,
    .ty-search-wrapper .ty-search-input:focus,
    .ty-search-wrapper input.ty-search-input:focus,
    .ty-search-input:focus,
    .search-bar-input:focus {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background-color: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    /* Hide search button on mobile - use enter key */
    .ty-search-btn {
        display: none !important;
    }

    /* Camera button for image search */
    .ty-camera-btn {
        display: flex !important;
        padding: 0 12px !important;
        color: #666;
        font-size: 16px !important;
        height: 44px !important;
        align-items: center !important;
    }

    /* HIDE the mobile search toggle icon - search bar is always visible */
    .open-search-form-mobile {
        display: none !important;
    }

    /* Close button for mobile search - not needed */
    .close-search-form-mobile {
        display: none !important;
    }

    /* Search dropdown - Full width bottom sheet on mobile */
    .ty-search-dropdown,
    .search-card {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-height: 70vh !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        background: #fff !important;
        z-index: 1060 !important;
    }

    .ty-trending-section {
        padding: 16px !important;
    }

    .ty-trending-header {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }

    .ty-trending-tag {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    /* ========================================
       NAVBAR TOOLBAR - Compact Icons
       ======================================== */
    .navbar-toolbar {
        gap: 4px !important;
        flex-shrink: 0;
    }

    .navbar-tool {
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-tool-icon-box {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .navbar-tool-icon-box i {
        font-size: 18px !important;
    }

    /* Hide wishlist icon on mobile (save space) */
    .navbar-tool.dropdown.d-none.d-md-block {
        display: none !important;
    }

    /* Hide text labels on toolbar */
    .navbar-tool-text {
        display: none !important;
    }

    /* User dropdown */
    .navbar-tool .img-profile {
        width: 28px !important;
        height: 28px !important;
    }

    /* Hide sign up/sign in buttons - use menu instead */
    .header-auth-btn {
        display: none !important;
    }

    /* Cart in toolbar */
    #cart_items .navbar-tool-icon-box {
        width: 36px !important;
        height: 36px !important;
    }

    .navbar-tool-label {
        top: -2px !important;
        right: -2px !important;
        min-width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
    }

    /* Stuck toggler - smaller */
    .navbar-stuck-toggler {
        display: none !important;
    }

    /* ========================================
       SECOND NAVBAR ROW - Hide on Mobile
       ======================================== */
    .navbar-stuck-menu {
        display: none !important;
    }

    /* ========================================
       NAVBAR TOGGLER - HIDDEN ON MOBILE
       User requested: Remove hamburger icon, use space for search
       ======================================== */
    .navbar-toggler,
    .navbar-toggler-icon {
        display: none !important;
    }

    /* ========================================
       GENERAL HEADER FIXES
       ======================================== */
    header,
    .header-area,
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1050;
        background: #fff;
    }

    /* Remove extra shadows/borders */
    .navbar-sticky.bg-light {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    }

    /* Fix container width issues */
    .navbar .container {
        max-width: 100% !important;
    }

    /* ========================================
       MOBILE COLLAPSED MENU IMPROVEMENTS
       ======================================== */
    .navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 300px !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 1080 !important;
        padding: 16px !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15) !important;
    }

    .navbar-collapse.show {
        left: 0 !important;
        display: block !important;
    }

    [dir="rtl"] .navbar-collapse {
        left: auto !important;
        right: -100% !important;
    }

    [dir="rtl"] .navbar-collapse.show {
        right: 0 !important;
        left: auto !important;
    }

    .navbar-collapse .navbar-nav {
        display: flex !important;
        flex-direction: column !important;
    }

    .navbar-collapse .nav-item {
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-collapse .nav-link {
        padding: 12px 0 !important;
        font-size: 15px !important;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Close button for menu */
    .navbar-collapse .w-100.d-md-none {
        display: flex !important;
        justify-content: flex-end;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid #eee;
    }
}

@media (min-width: 768px) {
    .mobile-header,
    .hamburger-btn,
    .mobile-menu-toggle,
    .mobile-nav-drawer,
    .mobile-nav-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   Phase 6: User Story 4 - Vendor Dashboard
   ========================================================================== */

/* T042: Vendor dashboard widget mobile styles */
@media (max-width: 767.98px) {
    .vendor-dashboard .dashboard-widgets,
    .seller-dashboard .stats-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .vendor-dashboard .widget-card,
    .seller-dashboard .stat-card {
        padding: 16px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .widget-card .widget-value,
    .stat-card .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .widget-card .widget-label,
    .stat-card .stat-label {
        font-size: 0.875rem;
        color: #666;
    }
}

/* T043: Responsive chart container */
@media (max-width: 767.98px) {
    .chart-container,
    .chart-wrapper,
    .apexcharts-canvas {
        width: 100% !important;
        min-height: 200px;
        max-height: 300px;
    }

    .chart-container canvas,
    .chart-wrapper canvas {
        max-width: 100%;
        height: auto !important;
    }
}

/* T045: Table-to-card transformation for vendor */
@media (max-width: 767.98px) {
    .vendor-table,
    .seller-products-table,
    .table-responsive-card {
        display: block;
    }

    .vendor-table thead,
    .seller-products-table thead,
    .table-responsive-card thead {
        display: none;
    }

    .vendor-table tbody,
    .seller-products-table tbody,
    .table-responsive-card tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .vendor-table tr,
    .seller-products-table tr,
    .table-responsive-card tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .vendor-table td,
    .seller-products-table td,
    .table-responsive-card td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
    }

    [dir="rtl"] .vendor-table td,
    [dir="rtl"] .seller-products-table td,
    [dir="rtl"] .table-responsive-card td {
        text-align: left;
    }

    .vendor-table td:last-child,
    .seller-products-table td:last-child,
    .table-responsive-card td:last-child {
        border-bottom: none;
    }

    .vendor-table td::before,
    .seller-products-table td::before,
    .table-responsive-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
        flex: 0 0 40%;
        text-align: left;
    }

    [dir="rtl"] .vendor-table td::before,
    [dir="rtl"] .seller-products-table td::before,
    [dir="rtl"] .table-responsive-card td::before {
        text-align: right;
    }
}

/* T047: Mobile order detail styles */
@media (max-width: 767.98px) {
    .vendor-order-detail,
    .order-detail-card {
        padding: 16px;
    }

    .order-detail-header {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #eee;
    }

    .order-detail-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .order-detail-actions .btn {
        flex: 1;
        min-width: 120px;
        min-height: 44px;
    }
}

/* ==========================================================================
   Phase 7: User Story 5 - Admin Dashboard
   ========================================================================== */

/* T050: Admin dashboard widget mobile styles */
@media (max-width: 767.98px) {
    .admin-dashboard .dashboard-stats,
    .admin-dashboard .stat-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .admin-dashboard .stat-card {
        padding: 12px;
        text-align: center;
    }

    .admin-dashboard .stat-value {
        font-size: 1.25rem;
    }

    .admin-dashboard .stat-label {
        font-size: 0.75rem;
    }
}

/* T052: Table-to-card for admin tables */
@media (max-width: 767.98px) {
    .admin-table,
    .data-table,
    .table-admin {
        display: block;
    }

    .admin-table thead,
    .data-table thead,
    .table-admin thead {
        display: none;
    }

    .admin-table tbody,
    .data-table tbody,
    .table-admin tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .admin-table tr,
    .data-table tr,
    .table-admin tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .admin-table td,
    .data-table td,
    .table-admin td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .admin-table td:last-child,
    .data-table td:last-child,
    .table-admin td:last-child {
        border-bottom: none;
    }

    .admin-table td::before,
    .data-table td::before,
    .table-admin td::before {
        content: attr(data-label);
        font-weight: 600;
        flex: 0 0 40%;
        text-align: left;
    }

    [dir="rtl"] .admin-table td::before,
    [dir="rtl"] .data-table td::before,
    [dir="rtl"] .table-admin td::before {
        text-align: right;
    }
}

/* T054: Mobile-friendly modal/dialog styles */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header .close,
    .modal-header .btn-close {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }

    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 16px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
        min-height: 44px;
    }

    /* Full-screen modal on mobile */
    .modal-fullscreen-mobile .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-fullscreen-mobile .modal-content {
        height: 100%;
        border-radius: 0;
    }
}

/* T055: Mobile action button styles */
@media (max-width: 767.98px) {
    .admin-actions,
    .action-buttons,
    .table-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .admin-actions .btn,
    .action-buttons .btn,
    .table-actions .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .admin-actions .btn-icon,
    .action-buttons .btn-icon {
        padding: 10px;
    }

    .dropdown-menu {
        min-width: 200px;
        padding: 8px;
        border-radius: 12px;
    }

    .dropdown-item {
        padding: 12px 16px;
        border-radius: 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dropdown-item:active {
        background: #f5f5f5;
    }
}

/* ==========================================================================
   Phase 8: Polish & Cross-Cutting Concerns
   ========================================================================== */

/* T057: Portrait/landscape orientation support */
@media (max-width: 767.98px) and (orientation: landscape) {
    .mobile-header {
        padding: 8px 16px;
        min-height: 48px;
    }

    .modal-body {
        max-height: 50vh;
    }

    .mobile-nav-drawer {
        width: 50%;
        max-width: 280px;
    }
}

/* T058: Text truncation utilities */
.text-truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* T059: Loading indicator mobile styles */
/* Note: These styles only apply when .mobile-loading-active is added */
@media (max-width: 767.98px) {
    .mobile-loading-overlay.active {
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.9);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-loading-spinner {
        width: 48px;
        height: 48px;
        border: 4px solid #f0f0f0;
        border-top-color: var(--web-primary, #f27a1a);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    .skeleton-loader {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 8px;
    }

    @keyframes shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}

/* Additional utility classes */
@media (max-width: 767.98px) {
    .d-mobile-none {
        display: none !important;
    }

    .d-mobile-block {
        display: block !important;
    }

    .d-mobile-flex {
        display: flex !important;
    }

    .w-mobile-100 {
        width: 100% !important;
    }

    .p-mobile-0 {
        padding: 0 !important;
    }

    .m-mobile-0 {
        margin: 0 !important;
    }

    .gap-mobile-2 {
        gap: 8px !important;
    }

    .gap-mobile-3 {
        gap: 12px !important;
    }
}

@media (min-width: 768px) {
    .d-desktop-none {
        display: none !important;
    }

    .d-desktop-block {
        display: block !important;
    }

    .d-desktop-flex {
        display: flex !important;
    }
}

/* ==========================================================================
   MOBILE UI POLISH - Reducing Empty Space & Improving Attractiveness
   ========================================================================== */

@media (max-width: 767.98px) {
    /* ========================================
       CONTAINER & SECTION SPACING
       ======================================== */
    .container,
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Section titles and headers */
    .section-header,
    .section-title,
    .feature-title,
    .owl-theme .owl-nav {
        margin-bottom: 12px !important;
    }

    h2.section-title,
    .section-title h2 {
        font-size: 1.25rem !important;
    }

    /* Homepage sections - reduce vertical spacing */
    section,
    .home-section,
    .feature-section {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }

    /* ========================================
       BANNERS & SLIDERS - HERO SLIDER FIX
       ======================================== */
    /* Main banner/slider section */
    .__top-slider-images {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Hero slider - ensure proper display */
    .hero-slider {
        display: block !important;
        width: 100% !important;
    }

    .hero-slider .owl-stage-outer {
        overflow: hidden !important;
    }

    .hero-slider .owl-stage {
        display: flex !important;
        /* Override any grid styles */
    }

    .hero-slider .owl-item {
        flex-shrink: 0 !important;
    }

    .hero-slider .__slide-img {
        width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
        object-fit: cover;
    }

    .main-banner,
    .owl-carousel.banner-slider {
        margin-bottom: 12px !important;
    }

    .banner-content {
        padding: 16px !important;
    }

    /* Category banners */
    .category-banner,
    .promo-banner {
        border-radius: 8px !important;
        overflow: hidden;
        margin-bottom: 12px !important;
    }

    /* ========================================
       HORIZONTAL CATEGORY NAVIGATION - FIX ALIGNMENT
       ======================================== */
    /* Fix horizontal category section */
    .horizontal-category-section {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .horizontal-category-nav {
        width: 100% !important;
    }

    .horizontal-category-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0 !important;
        padding: 0 !important;
    }

    .horizontal-category-menu::-webkit-scrollbar {
        display: none;
    }

    .horizontal-category-item {
        flex-shrink: 0 !important;
    }

    .horizontal-category-item .category-link {
        padding: 10px 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    /* RTL fix for horizontal categories */
    [dir="rtl"] .horizontal-category-menu {
        flex-direction: row !important;
        justify-content: flex-start !important;
    }

    /* General horizontal categories class */
    .horizontal-categories,
    .category-nav-horizontal {
        padding: 8px 0 !important;
        margin-bottom: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .horizontal-categories::-webkit-scrollbar {
        display: none;
    }

    .horizontal-categories .category-item,
    .category-nav-horizontal .nav-item {
        flex-shrink: 0 !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* ========================================
       CARDS & CONTENT BLOCKS
       ======================================== */
    .card {
        border-radius: 10px !important;
        margin-bottom: 12px !important;
    }

    .card-body {
        padding: 12px !important;
    }

    .card-header,
    .card-footer {
        padding: 10px 12px !important;
    }

    /* ========================================
       FLASH DEALS & PROMOTIONAL SECTIONS
       ======================================== */
    .flash-deal-section,
    .flash_deal_product {
        padding: 12px !important;
    }

    .flash-deal-timer {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    .flash-deal-title {
        font-size: 1rem !important;
    }

    /* ========================================
       CAROUSELS & SLIDERS
       ======================================== */
    .owl-carousel .owl-stage-outer {
        padding: 4px 0 !important;
    }

    .owl-carousel .owl-item {
        padding: 0 4px !important;
    }

    .owl-nav {
        display: none !important;
    }

    .owl-dots {
        margin-top: 8px !important;
    }

    .owl-dots .owl-dot span {
        width: 6px !important;
        height: 6px !important;
        margin: 0 3px !important;
    }

    /* ========================================
       FOOTER IMPROVEMENTS
       ======================================== */
    footer,
    .footer {
        padding: 20px 0 !important;
    }

    .footer-widget {
        margin-bottom: 16px !important;
    }

    .footer-widget h5,
    .footer-widget .widget-title {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }

    .footer-links li {
        margin-bottom: 6px !important;
    }

    .footer-links a {
        font-size: 13px !important;
    }

    .footer-bottom {
        padding: 12px 0 !important;
        font-size: 12px !important;
    }

    /* Social icons */
    .social-icons {
        gap: 10px !important;
    }

    .social-icons a {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }

    /* ========================================
       ANNOUNCEMENT BAR
       ======================================== */
    #announcement {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    #announcement span {
        display: inline-block;
        max-width: calc(100% - 30px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .__close-announcement {
        padding: 4px 8px !important;
        font-size: 14px !important;
    }

    /* ========================================
       BREADCRUMBS
       ======================================== */
    .breadcrumb {
        padding: 8px 0 !important;
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 4px !important;
    }

    /* ========================================
       PAGE CONTENT AREAS
       ======================================== */
    .page-content,
    .main-content {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    /* Row gaps */
    .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    .row > [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* ========================================
       VENDOR/SHOP LISTING IMPROVEMENTS
       ======================================== */
    .shop-card,
    .vendor-card {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .shop-card .shop-info,
    .vendor-card .vendor-info {
        gap: 8px !important;
    }

    .shop-card .shop-logo,
    .vendor-card .vendor-logo {
        width: 50px !important;
        height: 50px !important;
    }

    /* ========================================
       EMPTY STATE & NO RESULTS
       ======================================== */
    .empty-state,
    .no-products,
    .no-results {
        padding: 30px 16px !important;
        text-align: center;
    }

    .empty-state img,
    .no-products img {
        max-width: 150px !important;
        margin-bottom: 16px !important;
    }

    .empty-state h4,
    .no-products h4 {
        font-size: 1.125rem !important;
    }

    .empty-state p,
    .no-products p {
        font-size: 14px !important;
    }

    /* ========================================
       PAGINATION
       ======================================== */
    .pagination {
        gap: 4px !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        min-width: 36px !important;
        height: 36px !important;
        padding: 8px !important;
        font-size: 13px !important;
    }

    /* ========================================
       ALERT & NOTIFICATION BOXES
       ======================================== */
    .alert {
        padding: 10px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .alert .close,
    .alert .btn-close {
        padding: 8px !important;
    }

    /* ========================================
       BADGES & LABELS
       ======================================== */
    .badge {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }

    /* ========================================
       REMOVE UNNECESSARY GAPS
       ======================================== */
    .mb-4 {
        margin-bottom: 12px !important;
    }

    .mb-5 {
        margin-bottom: 16px !important;
    }

    .mt-4 {
        margin-top: 12px !important;
    }

    .mt-5 {
        margin-top: 16px !important;
    }

    .py-4 {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .py-5 {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }

    /* ========================================
       CRITICAL: SEARCH INPUT FINAL OVERRIDES
       These must be at the end to have highest priority
       ======================================== */
    /* Ultra-specific selectors to guarantee override */
    body .navbar .ty-search-container .ty-search-wrapper .ty-search-input,
    body .navbar .ty-search-container .ty-search-wrapper input.ty-search-input,
    body .navbar .ty-search-container .ty-search-wrapper input[type="search"],
    body .ty-search-wrapper .ty-search-input,
    body input.ty-search-input,
    body input.search-bar-input,
    html body .ty-search-input,
    html body .search-bar-input {
        font-size: 16px !important;
        height: 40px !important;
        min-height: 40px !important;
        line-height: 24px !important;
        padding: 8px 12px 8px 0 !important;
        color: #222 !important;
        -webkit-text-fill-color: #222 !important;
        opacity: 1 !important;
        background: transparent !important;
        border: none !important;
        box-sizing: border-box !important;
        font-weight: normal !important;
        text-indent: 0 !important;
        letter-spacing: normal !important;
        caret-color: #f27a1a !important;
    }

    body .ty-search-wrapper,
    html body .ty-search-wrapper {
        height: 44px !important;
        min-height: 44px !important;
        background: #f8f8f8 !important;
        border: 2px solid #e0e0e0 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }

    body .ty-search-wrapper:focus-within,
    html body .ty-search-wrapper:focus-within {
        background: #fff !important;
        border-color: #f27a1a !important;
        box-shadow: 0 0 0 2px rgba(242, 122, 26, 0.2) !important;
    }

    /* Hide hamburger on mobile - use space for search */
    body .navbar-toggler,
    html body .navbar-toggler {
        display: none !important;
    }

    /* Compact logo on mobile */
    body .navbar-brand,
    body .ty-brand-logo,
    html body .navbar-brand {
        max-width: 40px !important;
        min-width: auto !important;
        margin-right: 8px !important;
    }

    /* ========================================
       ENSURE RTL SUPPORT
       ======================================== */
    [dir="rtl"] .container,
    [dir="rtl"] .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    [dir="rtl"] .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    [dir="rtl"] .row > [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}
