/**
 * MAGGWEAR E-TICARET - Responsive (Duyarli Tasarim) CSS
 *
 * Tum frontend sayfalari icin mobil uyumluluk stilleri.
 * Mobile-first yaklasim ile breakpoint'ler:
 *   - 576px  (sm)  : Kucuk telefonlar
 *   - 768px  (md)  : Tabletler
 *   - 992px  (lg)  : Kucuk laptoplar
 *   - 1200px (xl)  : Masaustu
 *   - 1400px (xxl) : Genis ekranlar
 *
 * @author  MaggWear Team
 * @version 2.0.0
 */

/* =====================================================
   GENEL DUYARLI KURALLAR
   ===================================================== */

/* Minimum dokunma alani - mobilde 44px */
@media (max-width: 768px) {
    a, button, .btn, input[type="submit"],
    input[type="button"], select, .form-control {
        min-height: 44px;
    }

    /* Genel bosluk azaltma */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    section {
        padding: 40px 0;
    }
}

/* =====================================================
   HEADER & NAVIGASYON
   ===================================================== */

/* Tablet ve alti */
@media (max-width: 992px) {
    .navbar {
        padding: 10px 0;
    }

    .navbar-brand img {
        max-height: 36px;
    }

    .navbar-brand span,
    .navbar-brand .brand-text {
        font-size: 20px;
    }

    .nav-icons .nav-link span,
    .header-search {
        display: none;
    }

    .top-bar {
        font-size: 11px;
    }
    .top-bar-left,
    .top-bar-right {
        justify-content: center;
    }
    .top-bar .separator {
        display: none;
    }
}

/* Mobil */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .navbar .container {
        padding: 0 10px;
    }

    .navbar-collapse {
        background: var(--primary-dark);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 15px;
        margin-top: 10px;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    }

    .navbar-nav .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 15px;
        color: #fff !important;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .nav-icons {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }

    .navbar-toggler {
        padding: 6px 10px;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 8px;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Kategori dropdown mobilde tam genislik */
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.06);
        padding-left: 15px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 8px;
        margin-top: 4px;
    }
    .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
    }
    .dropdown-menu .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }
}

/* Kucuk mobil */
@media (max-width: 576px) {
    .navbar-brand span,
    .navbar-brand .brand-text {
        font-size: 18px;
    }

    .navbar-brand img {
        max-height: 30px;
    }
}

/* =====================================================
   HERO / SLIDER BOLUMU
   ===================================================== */

@media (max-width: 992px) {
    .hero-section,
    .hero-slider .slide {
        min-height: 400px;
    }

    .hero-content h1,
    .hero-section h1 {
        font-size: 32px;
    }

    .hero-content p,
    .hero-section p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .hero-section,
    .hero-slider .slide {
        min-height: 320px;
        text-align: center;
    }

    .hero-content h1,
    .hero-section h1 {
        font-size: 26px;
        line-height: 1.3;
    }

    .hero-content p,
    .hero-section p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .hero-content .btn,
    .hero-section .btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section,
    .hero-slider .slide {
        min-height: 260px;
    }

    .hero-content h1,
    .hero-section h1 {
        font-size: 22px;
    }

    .hero-content p,
    .hero-section p {
        font-size: 13px;
    }
}

/* =====================================================
   URUN GRID / KARTLAR
   ===================================================== */

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card .product-title {
        font-size: 14px;
    }

    .product-card .product-price {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-card .product-body {
        padding: 10px;
    }

    .product-card .product-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }

    .product-card .product-price {
        font-size: 15px;
    }

    .product-card .product-actions {
        flex-direction: column;
        gap: 6px;
    }

    .product-card .product-actions .btn {
        width: 100%;
        font-size: 12px;
        padding: 8px;
    }

    /* Hover efektlerini mobilde kaldir */
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .product-card .product-overlay {
        display: none;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card .product-image img {
        height: 160px;
    }
}

/* =====================================================
   URUN DETAY SAYFASI
   ===================================================== */

@media (max-width: 992px) {
    .product-detail .row {
        flex-direction: column;
    }

    .product-gallery {
        margin-bottom: 20px;
    }

    .product-gallery .main-image img {
        max-height: 400px;
    }

    .product-gallery .thumbnail-list {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .product-detail-section {
        padding: 20px 0;
    }

    .product-info h1 {
        font-size: 22px;
    }

    .product-info .price {
        font-size: 24px;
    }

    .product-info .old-price {
        font-size: 16px;
    }

    .product-gallery .main-image img {
        max-height: 320px;
    }

    .product-gallery .thumbnail-list img {
        width: 55px;
        height: 55px;
    }

    .variant-options {
        flex-wrap: wrap;
    }

    .variant-option {
        min-width: 44px;
        min-height: 44px;
    }

    .quantity-control {
        margin: 15px 0;
    }

    .quantity-control button {
        width: 40px;
        height: 40px;
    }

    .product-detail-actions {
        flex-direction: column;
        gap: 10px;
    }

    .product-detail-actions .btn {
        width: 100%;
    }

    /* Sekmeler */
    .product-tabs .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .product-tabs .nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .product-gallery .main-image img {
        max-height: 260px;
    }

    .product-info h1 {
        font-size: 19px;
    }

    .product-info .price {
        font-size: 22px;
    }
}

/* =====================================================
   SEPET SAYFASI
   ===================================================== */

@media (max-width: 992px) {
    .cart-page .row {
        flex-direction: column;
    }

    .cart-summary {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .cart-section {
        padding: 20px 0;
    }

    .cart-table {
        display: block;
    }

    /* Tablo mobil goruntuleme */
    .cart-table thead {
        display: none;
    }

    .cart-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 15px;
        border-bottom: 1px solid #eee;
        align-items: center;
        gap: 10px;
    }

    .cart-table tbody td {
        border: none;
        padding: 4px 0;
    }

    .cart-table .cart-product-image {
        width: 80px;
    }

    .cart-table .cart-product-image img {
        width: 80px;
        height: 80px;
    }

    .cart-table .cart-product-info {
        flex: 1;
        min-width: 0;
    }

    .cart-table .cart-product-info h5 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .cart-quantity-control {
        display: flex;
        align-items: center;
    }

    .cart-quantity-control button {
        width: 36px;
        height: 36px;
    }

    .cart-summary-card {
        position: static;
    }

    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }

    .cart-actions .btn {
        width: 100%;
    }

    /* Kupon formu mobilde tam genislik */
    .coupon-form {
        flex-direction: column;
    }

    .coupon-form input {
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .coupon-form button {
        border-radius: 8px;
        width: 100%;
    }
}

/* =====================================================
   ODEME (CHECKOUT) SAYFASI
   ===================================================== */

@media (max-width: 992px) {
    .checkout-section .row {
        flex-direction: column;
    }

    .order-summary-sidebar {
        order: -1;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .checkout-section {
        padding: 20px 0;
    }

    .checkout-form .form-row {
        flex-direction: column;
    }

    .checkout-form .form-group {
        margin-bottom: 12px;
    }

    .checkout-form .form-control {
        font-size: 16px; /* iOS zoom onlemek icin */
    }

    .checkout-steps {
        font-size: 12px;
    }

    .checkout-steps .step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .payment-methods {
        flex-direction: column;
    }

    .payment-method-card {
        padding: 12px;
    }

    .order-summary-sidebar .order-item {
        flex-direction: row;
        gap: 10px;
    }

    .order-summary-sidebar .order-item img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .checkout-form label {
        font-size: 13px;
    }
}

/* =====================================================
   KATEGORI & FILTRE BOLUMU
   ===================================================== */

@media (max-width: 992px) {
    .products-page .row {
        flex-direction: column;
    }

    .filter-sidebar {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .products-page-section {
        padding: 20px 0;
    }

    /* Filtre mobilde acilir-kapanir */
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 1050;
        overflow-y: auto;
        padding: 20px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    }

    .filter-sidebar.active {
        left: 0;
    }

    .filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 1040;
    }

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

    .filter-toggle-btn {
        display: inline-flex !important;
    }

    .filter-close-btn {
        display: block !important;
    }

    .sort-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .sort-bar select {
        width: 100%;
    }

    .view-toggle {
        display: none;
    }
}

/* =====================================================
   ARAMA SAYFASI
   ===================================================== */

@media (max-width: 768px) {
    .search-section {
        padding: 20px 0;
    }

    .search-form-large {
        flex-direction: column;
        gap: 10px;
    }

    .search-form-large input {
        border-radius: 8px;
        font-size: 16px;
    }

    .search-form-large button {
        border-radius: 8px;
        width: 100%;
    }

    .search-results-info {
        font-size: 13px;
    }
}

/* =====================================================
   ILETISIM SAYFASI
   ===================================================== */

@media (max-width: 992px) {
    .contact-section .row {
        flex-direction: column;
    }
    .contact-page .contact-info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .contact-section {
        padding: 20px 0;
    }

    .contact-form .form-row {
        flex-direction: column;
    }

    .contact-page .contact-info-card {
        padding: 18px;
    }

    .contact-map {
        height: 250px;
    }

    .contact-map iframe {
        height: 250px;
    }
}

/* =====================================================
   HAKKIMIZDA SAYFASI
   ===================================================== */

@media (max-width: 992px) {
    .about-page .about-image-placeholder {
        height: 320px;
    }
    .about-page .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .about-page .about-content {
        padding-left: 0;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .about-page .section-padding {
        padding: 36px 0;
    }

    .about-page .about-title {
        font-size: 26px;
    }

    .about-page .about-image-placeholder {
        height: 260px;
    }

    .about-page .vision-card,
    .about-page .value-card {
        padding: 24px;
    }

    .about-page .about-stat {
        padding: 18px;
    }

    .about-page .about-stat-number {
        font-size: 32px;
    }
}

/* =====================================================
   FOOTER
   ===================================================== */

@media (max-width: 992px) {
    .footer-main .row {
        gap: 20px;
    }

    .footer-col {
        flex: 0 0 48%;
    }
}

@media (max-width: 768px) {
    .footer-main {
        padding: 30px 0;
    }

    .footer-col {
        flex: 0 0 100%;
        text-align: center;
    }

    .footer-col h4 {
        margin-bottom: 10px;
        font-size: 16px;
    }

    .footer-col ul {
        margin-bottom: 10px;
    }

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

    .footer-newsletter form {
        max-width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .footer-newsletter input {
        border-radius: 8px;
    }

    .footer-newsletter button {
        border-radius: 8px;
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px 0;
    }

    .footer-bottom .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-payment-icons {
        justify-content: center;
    }
}

/* =====================================================
   SAYFA BASLIKLARI (BREADCRUMB / PAGE HEADER)
   ===================================================== */

@media (max-width: 768px) {
    .page-header,
    .breadcrumb-section {
        padding: 20px 0;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .breadcrumb {
        font-size: 12px;
    }

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

/* =====================================================
   SIPARIS TAMAMLAMA SAYFASI
   ===================================================== */

@media (max-width: 768px) {
    .order-complete-section {
        padding: 30px 0;
    }

    .order-complete-card {
        padding: 20px;
    }

    .order-complete-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .order-complete-card h2 {
        font-size: 22px;
    }

    .order-summary-table {
        font-size: 13px;
    }
}

/* =====================================================
   PAGINATION (SAYFALAMA)
   ===================================================== */

@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .pagination .page-link {
        min-width: 38px;
        min-height: 38px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* =====================================================
   GENEL YARDIMCI SINIFLARI
   ===================================================== */

/* Mobilde gizle/goster */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }

    .filter-toggle-btn {
        display: none !important;
    }

    .filter-close-btn {
        display: none !important;
    }
}

/* Mobilde metin hizalama */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Mobilde tam genislik butonlar */
@media (max-width: 576px) {
    .btn-block-mobile {
        display: block;
        width: 100%;
    }

    .d-flex-mobile-column {
        flex-direction: column !important;
    }
}

/* =====================================================
   KATEGORI KARTLARI (ANASAYFA)
   ===================================================== */

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 15px;
    }

    .category-card .category-icon {
        font-size: 32px;
    }

    .category-card h5 {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* =====================================================
   MODAL DUYARLI TASARIMI
   ===================================================== */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-body {
        padding: 15px;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-footer {
        padding: 10px 15px;
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* =====================================================
   TABLO DUYARLI TASARIMI
   ===================================================== */

@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
}

/* =====================================================
   FORM DUYARLI TASARIMI
   ===================================================== */

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 12px;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* iOS zoom engellemek icin min 16px */
        padding: 10px 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row > .form-group,
    .form-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    textarea.form-control {
        min-height: 100px;
    }
}

/* =====================================================
   ALERT / BILDIRIM DUYARLI
   ===================================================== */

@media (max-width: 768px) {
    .alert {
        padding: 12px 15px;
        font-size: 13px;
        border-radius: 8px;
    }

    .alert i {
        font-size: 18px;
    }
}

/* =====================================================
   SMOOTH SCROLL VE PERFORMANS
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Yatay tasmaya engel - global */
html, body {
    overflow-x: hidden;
}

/* Gorsel iceriklerin tasmamasi */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* =====================================================
   HOMEPAGE MW- SECTIONS RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    /* Newsletter */
    .newsletter-section .row {
        text-align: center;
    }
    .newsletter-form .input-group {
        flex-direction: column;
    }
    .newsletter-form .form-control {
        border-radius: 25px;
        margin-bottom: 8px;
    }
    .newsletter-form .btn {
        border-radius: 25px;
        width: 100%;
    }

    /* Footer credits */
    .footer-credits {
        justify-content: center;
        text-align: center;
        margin-top: 10px;
    }
    .footer-payment-bar {
        padding: 16px 0;
    }
    .payment-icons {
        gap: 14px;
    }
    .payment-icons i {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .footer-bottom .col-md-6 {
        text-align: center !important;
    }
    .footer-credits {
        justify-content: center;
    }
}
