/* ============================================
   طراحی موبایل حرفه‌ای و مدرن - Responsive Design
   ============================================ */

/* ========== Breakpoints ========== */
/* 
   Mobile: < 576px
   Tablet: 576px - 768px
   Desktop: > 768px
*/

/* ========== Variables ========== */
:root {
    --mobile-padding: 1rem;
    --mobile-gap: 1rem;
    --mobile-border-radius: 12px;
    --mobile-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --mobile-transition: all 0.3s ease;
}

/* ========== Global Mobile Styles ========== */
@media (max-width: 767.98px) {
    /* Reset margins and paddings */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .container,
    .container-fluid {
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 0.875rem;
    }
    
    h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    h4, h5, h6 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    p {
        margin-bottom: 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        border-radius: var(--mobile-border-radius);
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
        box-shadow: var(--mobile-shadow);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .card-footer {
        padding: 0.875rem 1rem;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        border-radius: var(--mobile-border-radius);
        margin-bottom: 0.75rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem;
    }
    
    .table-responsive {
        border-radius: var(--mobile-border-radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
}

/* ========== Header & Navigation ========== */
@media (max-width: 767.98px) {
    /* Site Header */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .header-main {
        padding: 0.75rem 0;
    }
    
    .header-main .container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    /* Logo */
    .header-logo {
        text-align: center;
    }
    
    .header-logo .logo-img {
        height: 40px;
        max-width: 150px;
    }
    
    /* Search Form */
    .site-search-form,
    .search-form {
        width: 100%;
        margin: 0;
    }
    
    .site-search-input,
    .search-form .form-control {
        width: 100% !important;
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .search-input-wrapper {
        width: 100%;
        position: relative;
    }
    
    .search-suggestions {
        width: 100% !important;
        right: 0 !important;
        left: 0 !important;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .search-form .btn,
    .site-search-form .btn {
        min-width: 50px;
        padding: 0.625rem;
        margin-right: 0.5rem;
    }
    
    /* Header Actions */
    .header-actions {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
    }
    
    .header-actions .icon-btn {
        width: 48px;
        height: 48px;
        font-size: 0.75rem;
        padding: 0.5rem;
        flex: 1;
        min-width: 0;
    }
    
    .header-actions .icon-btn i {
        font-size: 1rem;
    }
    
    .cart-count {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }
    
    /* Navigation */
    .header-nav {
        display: none;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-toggler {
        padding: 0.375rem 0.75rem;
        font-size: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e5e7eb;
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        border-radius: var(--mobile-border-radius);
    }
    
    /* Category Menu */
    .category-dropdown {
        width: 100%;
    }
    
    .category-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border: 1px solid #e5e7eb;
        border-radius: var(--mobile-border-radius);
        background: #fff;
    }
    
    .category-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        border-radius: var(--mobile-border-radius);
        margin-top: 0.5rem;
        max-height: 400px;
        overflow-y: auto;
    }
    
    .category-item {
        padding: 0.75rem 1rem;
    }
    
    .category-submenu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e5e7eb;
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .category-item:hover .category-submenu {
        display: block;
    }
    
    .header-links {
        display: none;
    }
}

/* ========== Hero Section ========== */
@media (max-width: 767.98px) {
    .hero-slider {
        padding: 2rem 0;
        margin-bottom: 1.5rem;
    }
    
    .hero-slider h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-slider p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .page-hero-section {
        padding: 2rem 0;
    }
    
    .page-hero-section h1 {
        font-size: 1.75rem;
    }
    
    .page-hero-section .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-stats-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .hero-stats-card .label {
        font-size: 0.7rem;
    }
    
    .hero-stats-card strong {
        font-size: 1.1rem;
    }
}

/* ========== Product Cards ========== */
@media (max-width: 767.98px) {
    .product-card {
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-image {
        max-height: 200px;
        border-radius: var(--mobile-border-radius) var(--mobile-border-radius) 0 0;
    }
    
    .product-card .card-body {
        padding: 0.875rem;
    }
    
    .product-card .card-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-card .price {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .old-price {
        font-size: 0.8rem;
    }
    
    .product-card .discount-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .product-card .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Product Grid */
    .row.g-4 {
        --bs-gutter-y: 1rem;
    }
    
    .col-md-3,
    .col-md-4,
    .col-lg-3,
    .col-lg-4 {
        margin-bottom: 1rem;
    }
}

/* ========== Product Detail Page ========== */
@media (max-width: 767.98px) {
    .product-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .product-image-main {
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .product-image-main img {
        width: 100%;
        height: auto;
        border-radius: var(--mobile-border-radius);
    }
    
    .product-gallery {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .product-gallery img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: var(--mobile-border-radius);
        cursor: pointer;
        flex-shrink: 0;
    }
    
    .product-meta {
        padding: 0.75rem 0;
        margin: 1rem 0;
    }
    
    .meta-item {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }
    
    .product-price-section {
        padding: 1rem;
        border-radius: var(--mobile-border-radius);
        margin-bottom: 1rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .product-old-price {
        font-size: 1rem;
    }
    
    .product-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    .quantity-selector {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 1rem 0;
    }
    
    .quantity-selector input {
        width: 80px;
        text-align: center;
        padding: 0.5rem;
    }
    
    .product-description {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .description-content {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .product-attributes {
        margin-top: 1rem;
    }
    
    .attribute-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: var(--mobile-border-radius);
    }
}

/* ========== Cart Page ========== */
@media (max-width: 767.98px) {
    .cart-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
        border-radius: var(--mobile-border-radius);
    }
    
    .cart-item-details {
        flex: 1;
        padding-right: 0.75rem;
    }
    
    .cart-item-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    .cart-item-price {
        font-size: 0.875rem;
    }
    
    .cart-item-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .cart-item-actions .btn {
        width: 100%;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .cart-summary {
        position: static;
        margin-top: 1.5rem;
        padding: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .cart-summary-item {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 0;
        font-size: 0.875rem;
    }
    
    .cart-total {
        font-size: 1.25rem;
        padding: 1rem 0;
        border-top: 2px solid #e5e7eb;
        margin-top: 0.75rem;
    }
    
    .cart-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .cart-actions .btn {
        width: 100%;
    }
}

/* ========== Checkout Page ========== */
@media (max-width: 767.98px) {
    .checkout-form {
        margin-bottom: 1.5rem;
    }
    
    .checkout-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .checkout-section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .order-summary {
        position: static;
        margin-top: 1.5rem;
        padding: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .order-summary-item {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 0;
        font-size: 0.875rem;
    }
    
    .order-total {
        font-size: 1.25rem;
        padding: 1rem 0;
        border-top: 2px solid #e5e7eb;
        margin-top: 0.75rem;
    }
}

/* ========== Category Page ========== */
@media (max-width: 767.98px) {
    .category-sidebar {
        margin-bottom: 1.5rem;
    }
    
    .category-filters {
        padding: 1rem;
        border-radius: var(--mobile-border-radius);
        margin-bottom: 1rem;
    }
    
    .filter-section {
        margin-bottom: 1rem;
    }
    
    .filter-section-title {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }
    
    .filter-options {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-checkbox,
    .filter-radio {
        font-size: 0.875rem;
    }
    
    .category-products {
        margin-top: 1rem;
    }
    
    .category-header {
        margin-bottom: 1rem;
    }
    
    .category-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .category-description {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .sort-options {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .sort-options select {
        width: 100%;
    }
}

/* ========== Blog Page ========== */
@media (max-width: 767.98px) {
    .blog-post {
        margin-bottom: 1.5rem;
    }
    
    .blog-post-image {
        height: 200px;
        border-radius: var(--mobile-border-radius) var(--mobile-border-radius) 0 0;
    }
    
    .blog-post-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .blog-post-meta {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .blog-post-excerpt {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .blog-post-footer {
        padding: 0.75rem 0;
        font-size: 0.8rem;
    }
}

/* ========== About & Contact Pages ========== */
@media (max-width: 767.98px) {
    .page-content {
        padding: 1rem 0;
    }
    
    .contact-info {
        margin-bottom: 1.5rem;
    }
    
    .contact-info-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .contact-form {
        padding: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .contact-form .form-group {
        margin-bottom: 1rem;
    }
    
    .map-container {
        height: 250px;
        border-radius: var(--mobile-border-radius);
        margin-top: 1rem;
    }
}

/* ========== Customer Pages ========== */
@media (max-width: 767.98px) {
    /* Login & Register */
    .login-page,
    .register-page {
        padding: 1rem;
        min-height: auto;
    }
    
    .login-container,
    .register-container {
        max-width: 100%;
        padding: 1.5rem;
        margin: 0;
    }
    
    .login-form,
    .register-form {
        margin-top: 1rem;
    }
    
    /* Profile Page */
    .customer-profile-header {
        padding: 1rem 0;
    }
    
    .profile-header-main {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .profile-header-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .profile-header-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .customer-profile-content {
        padding: 1rem 0;
    }
    
    .profile-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .profile-card-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .order-card {
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .order-header {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    .order-items {
        padding: 0.75rem;
    }
    
    .order-item {
        padding: 0.75rem 0;
        font-size: 0.85rem;
    }
    
    .order-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .order-actions .btn {
        width: 100%;
        font-size: 0.8rem;
    }
}

/* ========== Footer ========== */
@media (max-width: 767.98px) {
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    .footer-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links a {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }
    
    .footer-social {
        display: flex;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .footer-social a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .footer-bottom {
        text-align: center;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.8rem;
    }
}

/* ========== Sliders & Banners ========== */
@media (max-width: 767.98px) {
    .carousel-item img {
        height: 250px;
        object-fit: cover;
    }
    
    .carousel-caption {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .carousel-caption h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .top-banner {
        padding: 0.75rem 0;
        font-size: 0.8rem;
    }
}

/* ========== Featured Categories ========== */
@media (max-width: 767.98px) {
    .featured-category-card {
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .featured-category-image {
        height: 150px;
        border-radius: var(--mobile-border-radius) var(--mobile-border-radius) 0 0;
    }
    
    .featured-showcase-item {
        margin-bottom: 1rem;
    }
    
    .featured-showcase-image {
        height: 180px;
        border-radius: var(--mobile-border-radius);
    }
}

/* ========== Search Page ========== */
@media (max-width: 767.98px) {
    .search-results {
        margin-top: 1rem;
    }
    
    .search-result-item {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--mobile-border-radius);
    }
    
    .search-result-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .search-result-meta {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .search-result-excerpt {
        font-size: 0.875rem;
        line-height: 1.6;
    }
}

/* ========== 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;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .mb-mobile-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-mobile-3 {
        margin-bottom: 1rem !important;
    }
    
    .p-mobile-2 {
        padding: 0.5rem !important;
    }
    
    .p-mobile-3 {
        padding: 1rem !important;
    }
}

/* ========== Tablet Styles (576px - 768px) ========== */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 100%;
    }
    
    .product-card .card-title {
        font-size: 1rem;
    }
    
    .product-card .price {
        font-size: 1.1rem;
    }
    
    .header-actions .icon-btn {
        width: 56px;
        height: 56px;
    }
    
    .cart-item-image {
        width: 100px;
        height: 100px;
    }
}

/* ========== Touch Optimizations ========== */
@media (max-width: 767.98px) {
    /* Increase touch target size */
    a,
    button,
    .btn,
    .nav-link,
    .icon-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Smooth scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent text size adjustment on orientation change */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Better tap highlighting */
    a,
    button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* ========== Print Styles ========== */
@media print {
    .site-header,
    .footer,
    .btn,
    .navbar,
    .header-actions {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .page-break {
        page-break-after: always;
    }
}



