/**
 * Saklıdağ Responsive Stylesheet
 *
 * @package Saklidag
 */

/* ==========================================================================
   Desktop Large (< 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .saklidag-products-grid.products-cols-5,
    ul.products.columns-5 {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .footer-columns-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    .col-brand, .col-newsletter {
        grid-column: span 3;
    }
}

/* ==========================================================================
   Tablets (< 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .saklidag-hero-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-main-banner {
        height: auto !important;
        min-height: 330px !important;
    }

    .hero-heading {
        font-size: 26px;
    }

    .categories-carousel-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-banners-grid {
        grid-template-columns: 1fr;
    }

    .saklidag-products-grid.products-cols-5,
    ul.products.columns-5,
    .saklidag-products-grid.products-cols-4,
    ul.products.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* 2-Column Responsive Footer for Tablet & Mobile */
    .footer-columns-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 32px 24px !important;
    }

    .col-brand {
        grid-column: span 2 !important;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .col-corporate {
        grid-column: 1 !important;
    }

    .col-categories {
        grid-column: 2 !important;
    }

    .col-customer-service {
        grid-column: 1 !important;
    }

    .col-newsletter {
        grid-column: 2 !important;
    }

    .col-newsletter .newsletter-input-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .col-newsletter .newsletter-input-group .newsletter-input {
        width: 100% !important;
        border-radius: 6px !important;
        height: 38px !important;
    }

    .col-newsletter .newsletter-input-group .newsletter-btn {
        width: 100% !important;
        border-radius: 6px !important;
        height: 38px !important;
        justify-content: center !important;
    }

    .single-product div.product {
        flex-direction: column;
        padding: 24px;
        gap: 24px;
    }

    .single-product div.product .woocommerce-product-gallery,
    .single-product div.product .summary {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .saklidag-nav-bar {
        display: none; /* Replaced by mobile drawer navigation */
    }

    .saklidag-mobile-nav-toggle {
        display: flex;
    }

    .header-actions-col .action-label {
        display: none !important; /* Keep icons clean on tablet/mobile */
    }

    .header-actions-col {
        gap: 6px;
    }

    .saklidag-action-link {
        padding: 4px;
        gap: 0;
    }

    .header-main-row {
        gap: 16px;
    }
}

/* ==========================================================================
   Mobile (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .saklidag-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .saklidag-topbar {
        font-size: 11px;
        padding: 6px 0;
    }

    .saklidag-topbar .topbar-left {
        display: none; /* Hide long shipping message on small screens */
    }

    .saklidag-topbar .topbar-inner {
        justify-content: center;
    }

    .topbar-right {
        gap: 10px;
    }

    .topbar-wa-link {
        font-size: 11px;
        gap: 4px;
    }

    .topbar-wa-link svg {
        width: 13px;
        height: 13px;
    }

    .topbar-socials {
        gap: 6px;
    }

    .topbar-socials svg {
        width: 12px;
        height: 12px;
    }

    /* Professional 2-Row Mobile Header:
       Row 1: [Menu Toggle] [Logo] [Actions: User, Wishlist, Cart]
       Row 2: [Search Bar (Full Width)]
    */
    .saklidag-main-header {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .header-main-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0 10px;
        gap: 0;
    }

    /* 1. Mobile Menu Button */
    .saklidag-mobile-nav-toggle {
        order: 1;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-right: 6px;
        color: #1f2937;
        background: transparent;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background-color 0.15s;
    }

    .saklidag-mobile-nav-toggle:active {
        background-color: #f3f4f6;
    }

    .saklidag-mobile-nav-toggle svg {
        width: 24px;
        height: 24px;
    }

    /* 2. Logo */
    .header-logo-col {
        order: 2;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        max-width: 140px !important;
        min-width: 80px;
    }

    .saklidag-logo-link {
        display: flex;
        align-items: center;
        max-width: 100%;
    }

    .saklidag-main-header .saklidag-logo-img,
    .saklidag-main-header .header-logo-col img,
    body.woocommerce .saklidag-main-header .saklidag-logo-img,
    body.woocommerce-page .saklidag-main-header .saklidag-logo-img,
    .saklidag-logo-img,
    img.custom-logo {
        max-width: 130px !important;
        max-height: 36px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }

    /* 3. Action Icons (Account, Wishlist, Cart) */
    .header-actions-col {
        order: 3;
        display: flex;
        align-items: center;
        gap: 4px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .header-actions-col .saklidag-action-link {
        padding: 2px;
        margin: 0;
    }

    .header-actions-col .action-icon {
        width: 35px;
        height: 35px;
    }

    .header-actions-col .action-icon svg {
        width: 19px;
        height: 19px;
    }

    .header-actions-col .action-label {
        display: none !important;
    }

    /* 4. Full-width Modern Search Bar (Row 2) */
    .header-search-col {
        order: 4;
        width: 100%;
        max-width: 100%;
        flex: 1 0 100%;
        margin-top: 8px;
    }

    .saklidag-search-form {
        display: flex;
        align-items: center;
        background: #f7f7f8;
        border: 1px solid #e5e7eb;
        border-radius: 24px;
        padding: 2px 6px 2px 14px;
        box-shadow: none;
        transition: all 0.2s ease;
    }

    .saklidag-search-form:focus-within {
        background: #ffffff;
        border-color: var(--st-brand, #9e1b22);
        box-shadow: 0 0 0 3px rgba(158, 27, 34, 0.08);
    }

    .saklidag-search-input {
        font-size: 13.5px;
        padding: 6px 8px;
        height: 32px;
        color: #1f2937;
    }

    .saklidag-search-input::placeholder {
        color: #9ca3af;
        font-size: 13px;
    }

    .saklidag-search-btn {
        padding: 6px 10px;
        color: #6b7280;
    }

    .saklidag-search-cat-select,
    .search-cat-dropdown-wrap {
        display: none !important;
    }

    .hero-main-banner {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
    }

    .hero-visual-col {
        width: 100% !important;
        max-width: 100% !important;
        height: 220px !important;
        flex: none !important;
    }

    .hero-visual-col::after {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 35px;
        background: linear-gradient(to bottom, rgba(20, 19, 18, 0), #141312);
    }

    .hero-content-col {
        padding: 24px 20px;
    }

    .hero-heading {
        font-size: 22px;
    }

    .hero-desc {
        font-size: 13.5px;
        margin-bottom: 20px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* Horizontal scroll for categories on mobile */
    .categories-carousel-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 12px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .category-card {
        flex: 0 0 160px;
        scroll-snap-align: start;
        aspect-ratio: 1 / 1;
    }

    /* Bestsellers tabs on mobile */
    .section-head-with-tabs {
        flex-direction: column;
        align-items: flex-start;
    }

    .bestseller-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* 2 Columns on Mobile for products */
    .saklidag-products-grid.products-cols-5,
    ul.products.columns-5,
    .saklidag-products-grid.products-cols-4,
    ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .saklidag-product-card-inner {
        padding: 8px;
    }

    .saklidag-card-title {
        font-size: 12px;
        height: 32px;
    }

    .saklidag-card-price {
        font-size: 12.5px;
    }

    .saklidag-card-add-btn {
        padding: 5px 8px;
        font-size: 10.5px;
    }

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

    /* Mobile 2 Columns Footer - Prevents Cramping */
    .footer-columns-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 26px 16px !important;
    }

    .col-brand {
        grid-column: span 2 !important;
    }

    .col-corporate {
        grid-column: 1 !important;
    }

    .col-categories {
        grid-column: 2 !important;
    }

    .col-customer-service {
        grid-column: 1 !important;
    }

    .col-newsletter {
        grid-column: 2 !important;
    }

    .footer-title {
        font-size: 13.5px !important;
        margin-bottom: 10px !important;
    }

    .footer-links-list li {
        margin-bottom: 8px !important;
    }

    .footer-links-list a {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .footer-about-text {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .contact-line {
        font-size: 12px !important;
    }

    .footer-bottom-row {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    /* Show sticky buy bar on single product */
    .single-product .saklidag-sticky-buy-bar {
        display: block;
    }

    .single-product .saklidag-product-trust-badges {
        grid-template-columns: 1fr;
    }
}
