/* ========================================
   TUNCAY YEDEK PARÇA - RESPONSIVE STYLES
   Mobile & Tablet Compatibility
   ======================================== */

/* Large Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    .container {
        padding: 0 20px;
    }

    /* Header */
    .header-search {
        max-width: 300px;
    }

    .nav {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 14px;
        font-size: 0.9375rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    /* Product Page */
    .products-page {
        grid-template-columns: 240px 1fr;
        gap: 24px;
    }

    .product-detail {
        gap: 32px;
    }

    /* Contact */
    .contact-grid {
        gap: 32px;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    /* Typography scaling */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    /* Header - Mobile */
    .header-inner {
        flex-wrap: wrap;
    }

    .header-search,
    .header-contact,
    .nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    /* Mobile Menu */
    .mobile-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        padding: 24px;
        z-index: 999;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .mobile-menu.active {
        transform: translateX(0);
    }

    .mobile-menu .nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 24px;
    }

    .mobile-menu .nav-link {
        display: block;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: var(--radius);
        background: var(--bg-light);
    }

    .mobile-menu .search-box {
        margin-bottom: 24px;
    }

    .mobile-menu .header-contact {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-menu .header-phone,
    .mobile-menu .whatsapp-btn {
        justify-content: center;
    }

    /* Hero */
    .hero {
        padding: calc(var(--header-height) + 40px) 0 60px;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-search-box {
        flex-direction: column;
        padding: 12px;
    }

    .hero-search-box input {
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
    }

    .hero-search-box button {
        width: 100%;
        justify-content: center;
    }

    .vehicle-selector {
        flex-direction: column;
        width: 100%;
    }

    .vehicle-selector select,
    .vehicle-selector .btn-search {
        width: 100%;
    }

    /* Sections */
    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 32px;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .category-card {
        padding: 24px 16px;
    }

    .category-icon {
        width: 52px;
        height: 52px;
    }

    .category-icon svg {
        width: 26px;
        height: 26px;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-content {
        padding: 16px;
    }

    .product-card h3 {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.25rem;
    }

    /* Products Page */
    .products-page {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        border-radius: 0;
        transform: translateX(-100%);
        transition: var(--transition);
        overflow-y: auto;
    }

    .filter-sidebar.active {
        transform: translateX(0);
    }

    .filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: var(--bg-white);
        border: 2px solid var(--border);
        border-radius: var(--radius);
        font-weight: 500;
    }

    .products-header {
        flex-direction: column;
        align-items: stretch;
    }

    .products-sort {
        justify-content: space-between;
    }

    /* Product Detail */
    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        position: relative;
        top: 0;
    }

    .gallery-thumbs {
        justify-content: center;
    }

    .product-info h1 {
        font-size: 1.5rem;
    }

    .product-info .product-price {
        font-size: 2rem;
    }

    .vehicles-table {
        display: block;
        overflow-x: auto;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 20px;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form-wrapper {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links a:hover {
        padding-left: 0;
    }

    .footer-contact {
        align-items: center;
    }

    .footer-contact-item {
        text-align: left;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }

    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
    }

    /* Modal */
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
}

/* Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }

    .container {
        padding: 0 16px;
    }

    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.125rem; }

    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 0.9375rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }

    /* Logo */
    .logo img {
        height: 40px;
    }

    .logo-text {
        font-size: 1rem;
    }

    /* Hero */
    .hero {
        padding: calc(var(--header-height) + 32px) 0 48px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.9375rem;
        margin-bottom: 28px;
    }

    /* Categories */
    .categories-grid {
        gap: 12px;
    }

    .category-card {
        padding: 20px 12px;
    }

    .category-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .category-icon svg {
        width: 24px;
        height: 24px;
    }

    .category-card h4 {
        font-size: 0.9375rem;
    }

    /* Products Grid - Single Column */
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        display: flex;
        flex-direction: row;
    }

    .product-image {
        width: 120px;
        aspect-ratio: 1;
        flex-shrink: 0;
    }

    .product-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .product-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.625rem;
    }

    .product-category {
        font-size: 0.625rem;
        padding: 2px 8px;
        margin-bottom: 8px;
    }

    .product-card h3 {
        font-size: 0.9375rem;
        margin-bottom: 4px;
        -webkit-line-clamp: 1;
    }

    .product-compat {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .product-footer {
        padding-top: 12px;
    }

    .product-price {
        font-size: 1.125rem;
    }

    .product-actions .btn-icon {
        width: 36px;
        height: 36px;
    }

    .product-actions .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    /* Product Detail */
    .page-content {
        padding: calc(var(--header-height) + 24px) 0 60px;
    }

    .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .gallery-main {
        border-radius: var(--radius);
    }

    .gallery-thumbs {
        gap: 8px;
    }

    .gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .product-info h1 {
        font-size: 1.25rem;
    }

    .product-info .product-price {
        font-size: 1.75rem;
    }

    .stock-status {
        padding: 8px 12px;
        font-size: 0.875rem;
    }

    .vehicles-table th,
    .vehicles-table td {
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .contact-buttons .btn {
        padding: 14px 20px;
    }

    /* Features */
    .feature-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    /* Contact Page */
    .contact-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .contact-map {
        height: 250px;
    }

    .contact-form-wrapper {
        padding: 20px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 14px;
    }

    /* Footer */
    .footer {
        padding: 48px 0 0;
    }

    .footer-brand .logo-text {
        font-size: 1.25rem;
    }

    .footer h4 {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    /* Toast */
    .toast-container {
        left: 16px;
        right: 16px;
        top: 80px;
    }

    .toast {
        min-width: auto;
    }

    /* Filter Sidebar Mobile */
    .filter-header {
        position: sticky;
        top: 0;
        background: var(--bg-white);
        padding-top: 20px;
        margin-top: -24px;
        z-index: 1;
    }

    .filter-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--bg-light);
        border-radius: var(--radius);
    }
}

/* Very Small Phones (max-width: 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .hero h1 {
        font-size: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        flex-direction: column;
    }

    .product-image {
        width: 100%;
        aspect-ratio: 16/10;
    }
}

/* Landscape Mode Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: calc(var(--header-height) + 20px) 0 40px;
    }

    .vehicle-selector {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .vehicle-selector select {
        flex: 1;
        min-width: 120px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .filter-sidebar,
    .contact-buttons,
    .whatsapp-btn,
    .pagination {
        display: none !important;
    }

    .page-content {
        padding-top: 0;
    }

    .product-detail {
        display: block;
    }

    .product-gallery {
        max-width: 50%;
        float: left;
        margin-right: 24px;
        margin-bottom: 24px;
    }

    body {
        font-size: 12pt;
        color: black;
    }

    a {
        color: black;
        text-decoration: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border: #333333;
        --text-gray: #333333;
        --text-light: #555555;
    }

    .btn-primary,
    .btn-whatsapp {
        border: 2px solid currentColor;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (optional - for future) */
@media (prefers-color-scheme: dark) {
    /* Uncomment below for dark mode support */
    /*
    :root {
        --bg-white: #1a1a2e;
        --bg-light: #252540;
        --bg-gray: #2d2d44;
        --text-dark: #ffffff;
        --text-gray: #b0b0c0;
        --text-light: #8a8a9a;
        --border: #3d3d55;
        --primary: #ffffff;
        --primary-light: #e0e0e0;
    }
    */
}
