/* ============================================
   ParçaPortal - Mobile Responsive
   ============================================ */

/* ============================================
   Hamburger Menu Button (in nav bar)
   ============================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   Mobile Drawer (Sidebar)
   ============================================ */
.drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.mobile-drawer.open {
    right: 0;
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.drawer-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-title i {
    color: #60a5fa;
    font-size: 14px;
}

.drawer-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Drawer Body */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}

.drawer-body::-webkit-scrollbar {
    width: 3px;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Drawer Links */
.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
    position: relative;
}

.drawer-link i:first-child {
    color: #60a5fa;
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.drawer-link:hover,
.drawer-link.active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.drawer-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
    border-radius: 0 3px 3px 0;
}

/* Drawer Arrow */
.drawer-arrow {
    margin-left: auto;
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    transition: transform 0.3s ease;
}

.drawer-toggle.open .drawer-arrow {
    transform: rotate(180deg);
}

/* Drawer Submenu */
.drawer-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.drawer-submenu.open {
    max-height: 600px;
}

.drawer-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 52px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.drawer-submenu a i {
    font-size: 10px;
    color: #60a5fa;
    opacity: 0.6;
}

.drawer-submenu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

/* Drawer Group */
.drawer-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Drawer Footer */
.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.drawer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.drawer-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.4);
}

/* Hide drawer on desktop */
@media (min-width: 1025px) {

    .mobile-drawer,
    .drawer-overlay {
        display: none !important;
    }
}

/* ============================================
   Tablet (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    /* Header */
    .header-logo-row {
        gap: 12px;
    }

    .logo img,
    .site-logo {
        height: 55px;
        max-width: 200px;
    }

    .header-right-section .search-form {
        max-width: 320px;
    }

    .btn-ilan-ver span,
    .btn-login span {
        display: none;
    }

    .btn-ilan-ver,
    .btn-login {
        padding: 10px 14px;
    }

    /* Hero */
    .hero {
        padding: 50px 0 70px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    /* Search */
    .search-form {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
    }

    .search-form .btn {
        grid-column: 1 / -1;
    }

    .search-body {
        padding: 20px;
    }

    .search-section {
        padding: 0 20px;
    }

    /* Stats */
    .stats .container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 24px 16px;
    }

    .stat-item:nth-child(2) {
        border-right: none;
    }

    .stat-item:nth-child(1),
    .stat-item:nth-child(2) {
        border-bottom: 1px solid var(--border);
    }

    /* Content Grid / Sidebar */
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    /* Products Table => Cards */
    .products-table table thead {
        display: none;
    }

    .products-table table,
    .products-table table tbody,
    .products-table table tr,
    .products-table table td {
        display: block;
    }

    .products-table table tr {
        padding: 16px;
        border-bottom: 1px solid var(--border);
    }

    .products-table table td {
        padding: 4px 0;
        border: none;
    }

    /* Vitrin */
    .vitrin-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Product Cards Grid */
    .product-cards,
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Nav: show hamburger, hide desktop nav-list */
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav .nav-list {
        display: none;
    }

    /* Brands Grid */
    .brands-showcase .brands-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Featured Items */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Blog grid */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   Mobile (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    /* Header Top */
    .header-top {
        font-size: 12px;
        padding: 6px 0;
    }

    .header-top .container {
        flex-wrap: wrap;
        gap: 4px;
    }

    .header-top-right {
        display: none;
    }

    /* Header Logo Row - tek satır */
    .header-logo-row {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .logo img,
    .site-logo {
        height: 40px;
        max-width: 150px;
    }

    /* Search in header - gizle, hero search yeterli */
    .header-right-section {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .header-right-section .search-form,
    .header-logo-section .search-form {
        display: none;
    }

    .header-right-section .search-form input,
    .header-logo-section .search-form input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .header-right-section .search-form button,
    .header-logo-section .search-form button {
        padding: 10px 14px;
    }

    /* Header actions */
    .header-heart {
        width: 38px;
        height: 38px;
    }

    .user-menu-toggle {
        padding: 6px 10px !important;
    }

    .user-menu-text {
        display: none;
    }

    .btn-ilan-ver span,
    .btn-login span {
        display: none;
    }

    .btn-ilan-ver,
    .btn-login {
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 13px;
    }

    /* Hero */
    .hero {
        padding: 40px 0 60px;
    }

    .hero h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 14px;
    }

    .hero .trust-badges {
        flex-direction: column;
        gap: 8px;
    }

    /* Search Box */
    .search-section {
        margin-top: -40px;
        padding: 0 16px;
    }

    .search-header {
        padding: 16px;
    }

    .search-header h2 {
        font-size: 16px;
    }

    .search-body {
        padding: 16px;
    }

    .search-form {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .search-footer {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Stats */
    .stats .container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 20px 12px;
    }

    .stat-item .number {
        font-size: 28px;
    }

    .stat-item .icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    /* Results Header */
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Filters */
    .filters-bar {
        flex-direction: column;
    }

    .filters-bar select,
    .filters-bar input {
        min-width: auto;
        width: 100%;
    }

    /* Products */
    .product-cards,
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Vitrin */
    .vitrin-grid {
        grid-template-columns: 1fr !important;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer-social {
        justify-content: center;
    }

    /* Sidebar */
    .sidebar {
        position: static;
        margin-bottom: 20px;
    }

    /* Featured */
    .featured-grid {
        grid-template-columns: 1fr !important;
    }

    /* Brands */
    .brands-showcase .brands-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr !important;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Product Detail Page */
    .product-detail-grid {
        grid-template-columns: 1fr !important;
    }

    .product-gallery {
        max-height: 350px;
    }

    .product-thumbnails {
        gap: 6px;
    }

    .product-thumbnails img {
        width: 50px;
        height: 50px;
    }

    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr !important;
    }

    /* Dealer Page */
    .dealer-header-grid {
        grid-template-columns: 1fr !important;
    }

    /* Marka Page */
    .marka-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Blog Detail */
    .blog-detail-grid {
        grid-template-columns: 1fr !important;
    }

    /* Legal Pages */
    .legal-nav {
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px;
    }

    .legal-nav a {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        text-align: center;
        min-width: calc(50% - 4px);
    }

    .legal-hero h1 {
        font-size: 24px;
    }

    .legal-content-section {
        padding: 30px 0;
    }

    .legal-card {
        padding: 24px 16px;
    }

    /* Inner pages header */
    .header .container {
        flex-wrap: wrap;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        padding: 12px 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .header-nav.active {
        display: flex;
    }

    .header-nav a {
        padding: 12px 24px;
    }

    /* Dealer profile */
    .dealer-cover {
        height: 150px;
    }

    .dealer-avatar {
        width: 80px;
        height: 80px;
    }

    .dealer-info h1 {
        font-size: 22px;
    }

    .dealer-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dealer-stats .stat {
        flex: 1;
        min-width: calc(50% - 8px);
    }

    /* Show page */
    .product-main-image {
        height: 300px;
    }

    .similar-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   Small Mobile (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    /* Header */
    .header-top {
        display: none;
    }

    .header-logo-section {
        padding: 8px 0;
    }

    .logo img,
    .site-logo {
        height: 36px;
        max-width: 140px;
    }

    .header-right-section .search-form input,
    .header-logo-section .search-form input {
        padding: 8px 12px;
        font-size: 12px;
    }

    .header-right-section .search-form button,
    .header-logo-section .search-form button {
        padding: 8px 12px;
    }

    /* Hero */
    .hero {
        padding: 30px 0 50px;
    }

    .hero h1 {
        font-size: 20px;
    }

    .hero p {
        font-size: 13px;
    }

    /* Stats */
    .stats .container {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item {
        padding: 16px 8px;
    }

    .stat-item .number {
        font-size: 22px;
    }

    .stat-item .icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 8px;
    }

    .stat-item .label {
        font-size: 11px;
    }

    /* Brands */
    .brands-showcase .brands-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer */
    .footer-col h4 {
        font-size: 15px;
    }

    /* Legal */
    .legal-nav a {
        min-width: 100%;
    }

    /* Similar products & dealer */
    .similar-products-grid {
        grid-template-columns: 1fr !important;
    }

    .dealer-stats .stat {
        min-width: 100%;
    }

    .dealer-products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .header,
    .main-nav,
    .footer,
    .mobile-menu-toggle,
    .mobile-drawer,
    .drawer-overlay,
    .search-section {
        display: none !important;
    }
}