/* Souk Frontend Styles */

/* Reset and Base Styles */
.souk-landing-page,
.souk-seller-items-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.souk-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.souk-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.souk-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.souk-logo h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.souk-logo a {
    text-decoration: none;
    color: #2c98a0;
}

/* Mobile Menu Toggle */
.souk-mobile-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.souk-mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.souk-mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.souk-mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Navigation */
.souk-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.souk-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
    align-items: center;
}

.souk-nav-item {
    position: relative;
}

.souk-nav-link {
    text-decoration: none;
    color: #666;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.souk-nav-link:hover,
.souk-nav-link.active {
    background: #2c98a0;
    color: white;
}

/* Dropdown */
.souk-nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.souk-nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.souk-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.souk-nav-dropdown.active .souk-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.souk-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.souk-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #666;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-radius: 0;
}

.souk-dropdown-menu a:hover,
.souk-dropdown-menu a.active {
    background: #f8f9fa;
    color: #2c98a0;
}

/* Social Media Links */
.souk-social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: auto;
}

.souk-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.souk-social-link:hover {
    background: #2c98a0;
    color: white;
    transform: translateY(-2px);
}

.souk-search {
    min-width: 300px;
}

.souk-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    overflow: hidden;
    padding: 4px;
    border: 1px solid #d8e4e8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(28, 65, 78, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.souk-search-form:focus-within {
    border-color: #34b5b7;
    box-shadow: 0 0 0 3px rgba(52, 181, 183, 0.12), 0 7px 20px rgba(28, 65, 78, 0.08);
}

.souk-search-form input {
    flex: 1;
    width: 100%;
    min-width: 0 !important;
    height: 38px;
    box-sizing: border-box;
    padding: 0.45rem 3rem 0.45rem 0.85rem;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    font-size: 1rem;
    outline: none;
    color: #263746;
}

.souk-search-form input:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.souk-search-form button {
    position: absolute;
    right: 5px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    background: #2c98a0;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    max-width: 35px;
    max-height: 35px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    line-height: 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.souk-search-form button svg {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0;
    color: inherit;
    stroke: currentColor;
    flex: none;
}

html[dir="rtl"] .souk-search-form button,
body.souk-dir-rtl .souk-search-form button,
body.souk-lang-ar .souk-search-form button {
    right: auto;
    left: 5px;
}

html[dir="rtl"] .souk-search-form input,
body.souk-dir-rtl .souk-search-form input,
body.souk-lang-ar .souk-search-form input {
    padding-right: 0.85rem;
    padding-left: 3rem;
}

/* Breadcrumb */
.souk-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.souk-breadcrumb a {
    color: #2c98a0;
    text-decoration: none;
}

.souk-breadcrumb-separator {
    color: #ccc;
}

/* Hero Section */
.souk-hero {
    background: linear-gradient(135deg, #257f86, #4ae2d5);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
}

.souk-hero-content h2 {
    font-size: 3rem;
    margin: 0 0 1rem;
    font-weight: 700;
}

.souk-hero-content p {
    font-size: 1.2rem;
    margin: 0 0 2rem;
    opacity: 0.9;
}

/* Buttons */
.souk-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.souk-btn-primary {
    background: #2c98a0;
    color: white;
}

.souk-btn-primary:hover {
    background: #1b5c65;
    transform: translateY(-2px);
}

.souk-btn-secondary {
    background: #6c757d;
    color: white;
}

.souk-btn-secondary:hover {
    background: #5a6268;
}

.souk-btn-whatsapp {
    background: #25d366;
    color: white;
}

.souk-btn-whatsapp:hover {
    background: #1eb954;
}

.souk-btn-full {
    width: 100%;
}

/* Requested interaction colors for the public marketplace actions. */
.souk-cover-card .souk-cover-actions .souk-btn:hover,
.souk-cover-card .souk-cover-actions .souk-btn:focus-visible,
.souk-hero .souk-hero-content > .souk-btn:hover,
.souk-hero .souk-hero-content > .souk-btn:focus-visible {
    color: #14666c !important;
}

/* Category Filter */
.souk-category-filter {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.souk-category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.souk-category-btn:hover {
    color: #2c98a0;
}

.souk-category-btn.active {
    border-color: #2c98a0;
    background: #2c98a0;
    color: white;
}

/* Results Info */
.souk-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.souk-results-count {
    color: #666;
    font-size: 0.9rem;
}

/* Grids */
.souk-covers-grid,
.souk-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.souk-top-rated-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cover Card */
.souk-cover-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.souk-cover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.souk-cover-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.souk-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.souk-cover-card:hover .souk-cover-image img {
    transform: scale(1.05);
}

.souk-cover-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.souk-cover-content {
    padding: 1.5rem;
}

.souk-cover-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.souk-cover-seller {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.souk-seller-name {
    font-weight: 500;
    color: #666;
}

.souk-seller-level {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.souk-level-1 {
    background: #e3f2fd;
    color: #1976d2;
}

.souk-level-2 {
    background: #fff3e0;
    color: #f57c00;
}

.souk-level-3 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.souk-cover-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.souk-cover-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.souk-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.souk-cover-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.souk-cover-actions .souk-btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
}

/* Item Card */
.souk-item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.souk-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.souk-item-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.souk-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.souk-item-price {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #25d366;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.souk-item-content {
    padding: 1.25rem;
}

.souk-item-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.souk-item-code {
    color: #666;
    font-size: 0.8rem;
    margin: 0 0 0.5rem;
}

.souk-item-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.souk-item-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.souk-item-actions {
    margin-top: 1rem;
}

/* Seller Info */
.souk-seller-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.souk-seller-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.souk-seller-avatar {
    flex-shrink: 0;
}

.souk-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #2c98a0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.souk-seller-details h2 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: #333;
}

.souk-seller-owner,
.souk-seller-location {
    margin: 0.25rem 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.souk-level-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.souk-seller-actions {
    margin-top: 1rem;
}

/* Sections */
.souk-top-rated {
    background: white;
    padding: 3rem 0;
    margin: 2rem 0;
}

.souk-top-rated h3 {
    text-align: center;
    margin: 0 0 2rem;
    font-size: 2rem;
    color: #333;
}

.souk-seller-covers,
.souk-seller-items {
    padding: 2rem 0;
}

.souk-seller-covers h3,
.souk-seller-items h3 {
    margin: 0 0 1.5rem;
    font-size: 1.8rem;
    color: #333;
}

/* Load More */
.souk-load-more-container {
    text-align: center;
    margin: 2rem 0;
}

/* No Results */
.souk-no-results,
.souk-no-content {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.souk-no-results svg,
.souk-no-content svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.souk-no-results h3,
.souk-no-content h3 {
    margin: 1rem 0 0.5rem;
    color: #333;
}

/* Modal */
.souk-modal,
.souk-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.souk-modal.active,
.souk-search-modal.active {
    display: flex;
}

/* Lock body scroll when modal is open */
body.souk-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.souk-modal-content,
.souk-search-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    position: relative;
}

.souk-modal-header,
.souk-search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.souk-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.souk-modal-body {
    padding: 1.5rem;
}

.souk-modal-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Search Modal */
.souk-search-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.souk-tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.souk-tab-btn.active {
    color: #2c98a0;
    border-bottom-color: #2c98a0;
}

.souk-tab-content {
    display: none;
    padding: 1rem;
}

.souk-tab-content.active {
    display: block;
}

/* Search Results */
.souk-search-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.souk-search-result:hover {
    background-color: #f8f9fa;
}

.souk-search-result:last-child {
    border-bottom: none;
}

.souk-search-result-link {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.souk-search-result-link:hover {
    color: inherit;
    text-decoration: none;
}

.souk-search-result-image {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.souk-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.souk-item-price {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #2c98a0, #1b5c65);
    color: white;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
    min-width: 20px;
    text-align: center;
}

.souk-search-result-content {
    flex: 1;
    min-width: 0; /* Allow content to shrink */
}

.souk-search-result-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.souk-seller-name {
    margin: 0 0 0.3rem 0;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.souk-item-code {
    margin: 0 0 0.3rem 0;
    font-size: 0.7rem;
    color: #888;
    font-family: monospace;
}

.souk-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.souk-search-actions {
    margin-top: auto;
}

.souk-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.souk-btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
}

.souk-btn-whatsapp:hover {
    background: #1faa52;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.souk-no-results-text {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    margin: 0;
}

/* Footer */
.souk-footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

/* Loading */
.souk-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.souk-loading-overlay.active {
    display: flex;
}

.souk-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #2c98a0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .souk-container {
        padding: 0 15px;
    }
    
    .souk-header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1rem;
        position: relative;
        z-index: 100;
        align-items: flex-start;
    }
    
    /* Header sections for mobile */
    .souk-header-left {
        order: 1;
        flex: 0 0 auto;
    }
    
    .souk-mobile-toggle {
        order: 2;
        flex: 0 0 auto;
        align-self: flex-start;
        display: flex;
    }
    
    .souk-header-right {
        order: 3;
        flex: 1 1 100% !important;
        width: 100% !important;
        margin-top: 1rem;
        justify-content: center;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .souk-header-center {
        order: 4; /* Move navigation after search */
        flex: 1 1 100%;
        width: 100%;
        margin-top: 0.5rem; /* Small spacing after search */
    }
    
    .souk-language-switcher {
        display: none; /* Hide on mobile as it's shown in mobile menu */
    }
    
    /* Hide navigation by default on mobile */
    .souk-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        overflow-y: auto;
    }
    
    .souk-nav.souk-nav-open {
        right: 0;
    }
    
    .souk-nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .souk-nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .souk-nav-link {
        padding: 1rem 0;
        width: 100%;
        border-radius: 0;
        justify-content: space-between;
    }
    
    /* Dropdown for mobile */
    .souk-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin-top: 0;
        border-radius: 0;
        padding-left: 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .souk-nav-dropdown.active .souk-dropdown-menu {
        max-height: 300px;
        padding: 0.5rem 0 0.5rem 1rem;
    }
    
    .souk-dropdown-menu a {
        padding: 0.5rem 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .souk-dropdown-menu a:last-child {
        border-bottom: none;
    }
    
    /* Social links in mobile menu */
    .souk-social-links {
        margin-left: 0;
        margin-top: 2rem;
        justify-content: center;
        width: 100%;
        padding-top: 2rem;
        border-top: 1px solid #f0f0f0;
    }
    
    /* Body overlay when menu is open */
    body.souk-nav-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    /* Search on mobile - positioned under logo and mobile toggle */
    .souk-header-right .souk-search {
        min-width: 100% !important;
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 1 1 100% !important;
        order: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    .souk-header-right .souk-search-form {
        width: 100% !important;
        display: flex !important;
    }
    
    .souk-header-right .souk-search-form input {
        width: 100% !important;
        min-width: auto !important;
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
    }
    
    .souk-header-right .souk-search-form button {
        flex-shrink: 0;
        touch-action: manipulation;
    }
    
    .souk-hero-content h2 {
        font-size: 2rem;
    }
    
    .souk-covers-grid,
    .souk-items-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .souk-seller-info {
        flex-direction: column;
        text-align: center;
    }
    
    .souk-cover-actions {
        flex-direction: column;
    }
    
    .souk-category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .souk-category-btn {
        flex-shrink: 0;
    }
    
    .souk-results-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    /* Search modal mobile improvements */
    .souk-search-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .souk-search-modal-header {
        padding: 1rem;
    }
    
    .souk-search-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .souk-search-tabs {
        padding: 0 1rem;
    }
    
    .souk-tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .souk-search-results {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .souk-covers-grid,
    .souk-items-grid {
        grid-template-columns: 1fr;
    }
    
    .souk-hero {
        padding: 2rem 0;
    }
    
    .souk-hero-content h2 {
        font-size: 1.5rem;
    }
    
    .souk-modal-content,
    .souk-search-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    /* Mobile search results */
    .souk-search-result {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .souk-search-result-link {
        gap: 0.75rem;
    }
    
    .souk-search-result-image {
        width: 60px;
        height: 60px;
    }
    
    .souk-search-result-content h4 {
        font-size: 0.85rem;
    }
    
    .souk-seller-name {
        font-size: 0.7rem;
    }
    
    .souk-item-code {
        font-size: 0.65rem;
    }
    
    .souk-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    
    .souk-btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .souk-item-price {
        font-size: 0.65rem;
        padding: 1px 3px;
        top: 2px;
        right: 2px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .souk-search-result {
        gap: 0.5rem;
        padding: 0.4rem;
    }
    
    .souk-search-result-image {
        width: 50px;
        height: 50px;
    }
    
    .souk-search-result-content h4 {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .souk-seller-name {
        font-size: 0.65rem;
    }
    
    .souk-item-code {
        font-size: 0.6rem;
    }
    
    .souk-description {
        font-size: 0.7rem;
        display: none; /* Hide description on very small screens */
    }
    
    .souk-btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .souk-item-price {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }
}

/* Additional mobile search improvements for very small screens */
@media (max-width: 480px) {
    .souk-search-modal-content {
        width: 98%;
        margin: 1vh auto;
        max-height: 98vh;
    }
    
    .souk-search-modal-header {
        padding: 0.75rem;
    }
    
    .souk-search-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .souk-search-results {
        padding: 0.75rem;
    }
    
    .souk-search-form input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Force search visibility on mobile */
    .souk-header .souk-header-right {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .souk-header .souk-header-right .souk-search {
        display: block !important;
        width: 100% !important;
        min-height: 70px !important;
        padding: 10px !important;
        margin: 10px 0 !important;
    }
}

/* RTL (Arabic) specific mobile layout fixes */
@media (max-width: 768px) {
    body.souk-lang-ar .souk-header-content,
    body.souk-dir-rtl .souk-header-content,
    body[dir="rtl"] .souk-header-content {
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        position: relative !important;
        z-index: 100 !important;
        align-items: flex-start !important;
    }
    
    /* Arabic: Header sections for mobile */
    body.souk-lang-ar .souk-header-left,
    body.souk-dir-rtl .souk-header-left,
    body[dir="rtl"] .souk-header-left {
        order: 1 !important;
        flex: 0 0 auto !important;
    }
    
    body.souk-lang-ar .souk-mobile-toggle,
    body.souk-dir-rtl .souk-mobile-toggle,
    body[dir="rtl"] .souk-mobile-toggle {
        order: 2 !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        display: flex !important;
    }
    
    body.souk-lang-ar .souk-header-right,
    body.souk-dir-rtl .souk-header-right,
    body[dir="rtl"] .souk-header-right {
        order: 3 !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        margin-top: 1rem !important;
        justify-content: center !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    body.souk-lang-ar .souk-header-center,
    body.souk-dir-rtl .souk-header-center,
    body[dir="rtl"] .souk-header-center {
        order: 4 !important; /* Move navigation after search */
        flex: 1 1 100% !important;
        width: 100% !important;
        margin-top: 0.5rem !important; /* Small spacing after search */
    }
    
    /* Arabic: Search specific styles */
    body.souk-lang-ar .souk-header-right .souk-search,
    body.souk-dir-rtl .souk-header-right .souk-search,
    body[dir="rtl"] .souk-header-right .souk-search {
        min-width: 100% !important;
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 1 1 100% !important;
        order: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
}
