/**
 * Mobile Responsiveness - Drabiny Ewakuacyjne
 * Ulepszenia dla urzadzen mobilnych
 */

/* ============================================
   GLOBAL MOBILE IMPROVEMENTS
   ============================================ */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

/* Improve touch targets */
@media (max-width: 768px) {
    a, button, input[type="submit"], .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Better font scaling */
@media (max-width: 576px) {
    html {
        font-size: 15px;
    }
}

/* ============================================
   HEADER MOBILE - Menu przy 1000px
   ============================================ */
@media (max-width: 1150px) {
    /* Hamburger - widoczny, kolory w style.css */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 1.5rem;
        margin-left: 20px;
        border: none;
        border-radius: 10px;
        cursor: pointer;
    }

    /* Pozycjonowanie ikon */
    .header-cart {
        margin-left: auto !important;
        margin-right: 20px;
    }

    .header-account, .header-login {
        margin-left: 0 !important;
        margin-right: 0;
    }

    /* Ukryte menu - pokazuje się po kliknięciu */
    .main-nav {
        position: absolute !important;
        top: 100% !important;
        right: 20px !important;
        left: auto !important;
        bottom: auto !important;
        width: 280px;
        max-height: 80vh;
        background: #fff !important;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
        z-index: 999 !important;
        padding: 12px !important;
        overflow-y: auto !important;
        margin: 0 !important;
        opacity: 0 !important;
        visibility: hidden;
        transform: translateY(-10px) !important;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease !important;
    }

    .main-nav.active {
        opacity: 1 !important;
        visibility: visible;
        transform: translateY(0) !important;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 4px;
        padding: 0 !important;
    }

    .main-nav > ul > li {
        border-bottom: none;
        background: #f8fafc;
        border-radius: 10px;
        box-shadow: none;
        overflow: hidden;
    }

    .main-nav > ul > li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 12px 14px !important;
        font-size: 0.95rem;
        font-weight: 500;
        color: #1e293b !important;
        transition: all 0.2s ease;
    }

    .main-nav a:hover,
    .main-nav a.active {
        color: #933A3A !important;
        background: rgba(147, 58, 58, 0.05);
    }

    .main-nav a.active {
        border-left: 3px solid #933A3A;
    }

    /* Nav icons - show on mobile */
    .main-nav .nav-icon {
        display: block !important;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: #933A3A;
    }

    .main-nav a span:not(.dropdown-arrow) {
        flex: 1;
    }

    /* Dropdown arrow */
    .main-nav .dropdown-arrow {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }

    .main-nav .dropdown-arrow svg {
        width: 18px;
        height: 18px;
    }

    .main-nav .has-dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Dropdown na mobile */
    .main-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        background: #f1f5f9 !important;
        border-radius: 0 0 12px 12px;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding: 0 !important;
    }

    .main-nav .has-dropdown.open .dropdown-menu {
        max-height: 500px;
        padding: 8px 0 !important;
    }

    .main-nav .dropdown-menu li {
        background: none;
        box-shadow: none;
        border-radius: 0;
    }

    .main-nav .dropdown-menu a {
        padding: 10px 14px 10px 48px !important;
        font-size: 0.9rem;
        font-weight: 400;
        color: #64748b !important;
    }

    .main-nav .dropdown-menu a:hover {
        color: #933A3A !important;
        background: rgba(147, 58, 58, 0.08);
    }

    .main-nav .dropdown-divider {
        height: 1px;
        background: #e2e8f0;
        margin: 6px 14px;
    }

}

/* Przy 600px - tylko ikona logo bez tekstu */
@media (max-width: 600px) {
    .site-logo .logo-text {
        display: none !important;
    }

    .header-inner {
        padding: 10px 15px;
    }
}


/* ============================================
   HERO MOBILE
   ============================================ */
@media (max-width: 768px) {
    .hero, .drabiny-hero {
        padding: 100px 15px 60px;
        min-height: 70vh;
    }

    .hero h1 {
        font-size: 1.8rem;
        letter-spacing: 0.5px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
    }

    .hero .btn {
        padding: 14px 28px;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* ============================================
   SHOP PAGE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .shop-section {
        padding: 30px 0 60px;
    }

    .shop-header h1 {
        font-size: 1.6rem;
    }

    .shop-subtitle {
        font-size: 0.95rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-card {
        height: 200px;
    }

    .category-card h3 {
        font-size: 1.3rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-card-image {
        height: 160px;
    }

    .product-card-content {
        padding: 12px;
    }

    .product-card h3 {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .product-card-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-card-image {
        height: 200px;
    }
}

/* ============================================
   PRODUCT PAGE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .product-page {
        padding: 20px 0 40px;
    }

    .product-back-btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery {
        position: static;
    }

    .product-main-image {
        border-radius: 12px;
        max-height: 350px;
    }

    .product-thumbnails {
        gap: 8px;
    }

    .product-thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-info h1 {
        font-size: 1.5rem;
    }

    .product-price-box {
        padding: 20px;
    }

    .product-price-netto {
        font-size: 1.8rem;
    }

    .product-add-to-cart {
        flex-direction: column;
        gap: 12px;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }

    .btn-add-to-cart {
        width: 100%;
        padding: 16px;
    }

    .product-description {
        padding: 20px;
    }

    .related-products {
        padding: 30px 0;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .product-cta-banner {
        padding: 30px 15px;
    }

    .product-cta-banner h2 {
        font-size: 1.3rem;
    }
}

/* ============================================
   CART PAGE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .cart-hero {
        padding: 30px 0;
    }

    .cart-hero h1 {
        font-size: 1.8rem;
    }

    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cart-section {
        padding: 0;
    }

    .cart-table-wrapper {
        border-radius: 12px;
        overflow: hidden;
    }

    .cart-table th {
        display: none;
    }

    .cart-table tbody tr {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 10px;
        padding: 15px;
        border-bottom: 1px solid #e2e8f0;
        align-items: start;
    }

    .cart-table td {
        display: contents;
        padding: 0;
        border: none;
    }

    .cart-table td.col-image {
        grid-row: span 4;
    }

    .cart-table td.col-image img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
    }

    .cart-table td.col-product,
    .cart-table td.col-price,
    .cart-table td.col-quantity,
    .cart-table td.col-total {
        text-align: left;
        font-size: 0.95rem;
    }

    .cart-table td.col-remove {
        position: absolute;
        right: 15px;
        top: 15px;
    }

    .quantity-selector {
        justify-content: flex-start;
    }

    .quantity-selector button {
        width: 36px;
        height: 36px;
    }

    .quantity-selector input {
        width: 50px;
        height: 36px;
    }

    .cart-summary {
        position: static;
        border-radius: 12px;
    }

    .cart-summary-inner {
        padding: 20px;
    }

    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }

    .cart-coupon {
        width: 100%;
        flex-direction: column;
    }

    .cart-coupon input {
        width: 100%;
    }

    .cart-coupon button {
        width: 100%;
    }

    .cart-continue,
    .cart-checkout {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   ORDER PAGE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkout-form {
        order: 1;
    }

    .checkout-summary {
        order: 2;
        position: static;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-row .form-group {
        width: 100%;
    }

    .checkout-steps {
        gap: 8px;
    }

    .checkout-step {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .checkout-step-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
@media (max-width: 768px) {
    .site-footer .container {
        padding: 0 20px;
    }

    /* Ukryj ikonki w linkach na mobile - czystszy wygląd */
    .footer-links li svg {
        display: none;
    }

    /* Sekcje stopki - wyraźny podział */
    .footer-company,
    .footer-links,
    .footer-contact {
        display: block !important;
        text-align: center;
        padding-bottom: 25px;
        margin-bottom: 25px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .footer-contact {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    /* Nagłówki sekcji */
    .footer-links h4,
    .footer-contact h4 {
        display: inline-block;
        position: relative;
        margin-bottom: 20px;
    }

    .footer-links h4::after,
    .footer-contact h4::after {
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
    }

    /* Linki w kolumnie, wycentrowane */
    .footer-links ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-links li {
        margin-bottom: 0;
    }

    .footer-links a {
        font-size: 0.95rem;
        display: inline-block;
        padding: 5px 0;
    }

    /* Kontakt - wycentrowany */
    .footer-contact-items {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .footer-contact-item {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
    }

    .footer-contact-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .footer-contact-item a,
    .footer-contact-item span {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 30px 0 0 0;
        margin-top: 40px;
    }

    .site-footer .container {
        padding: 0 15px;
    }

    .footer-company,
    .footer-links,
    .footer-contact {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .footer-company h3 {
        font-size: 1.1rem;
    }

    .footer-company p {
        font-size: 0.85rem;
    }

    .footer-links h4,
    .footer-contact h4 {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .footer-links ul {
        gap: 8px;
    }

    .footer-links a {
        font-size: 0.9rem;
        padding: 4px 0;
    }

    .footer-contact-item {
        font-size: 0.9rem;
    }

    .footer-bottom {
        padding: 15px 0;
        font-size: 0.8rem;
    }

    .footer-bottom div {
        line-height: 1.5;
    }
}

/* ============================================
   FORMS MOBILE
   ============================================ */
@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px 16px;
    }

    .form-group label {
        font-size: 0.95rem;
    }
}

/* ============================================
   BUTTONS MOBILE
   ============================================ */
@media (max-width: 576px) {
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .btn-sm {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   SECTIONS MOBILE
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .container {
        padding: 0 15px;
    }
}

/* ============================================
   FAQ MOBILE
   ============================================ */
@media (max-width: 768px) {
    .faq-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .faq-item {
        border-radius: 10px;
    }

    .faq-question {
        padding: 16px;
        font-size: 0.95rem;
    }

    .faq-answer p {
        padding: 0 16px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   FEATURES GRID MOBILE
   ============================================ */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .feature-card h3 {
        font-size: 1.2rem;
    }
}

/* ============================================
   COOKIE BANNER MOBILE
   ============================================ */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }

    .cookie-banner-content {
        flex-direction: column;
        gap: 15px;
    }

    .cookie-banner-text {
        text-align: center;
    }

    .cookie-banner-text p {
        font-size: 0.9rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .cookie-btn {
        width: 100%;
        padding: 12px 16px;
    }

    .cookie-settings-modal {
        width: 95%;
        max-height: 85vh;
        margin: 20px auto;
    }
}

/* ============================================
   ALERTS AND MESSAGES MOBILE
   ============================================ */
@media (max-width: 768px) {
    .alert {
        padding: 15px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
}

/* ============================================
   TABLES MOBILE (general)
   ============================================ */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.responsive-table {
        min-width: 600px;
    }
}

/* ============================================
   LIGHTBOX MOBILE
   ============================================ */
@media (max-width: 768px) {
    .product-lightbox img {
        max-width: 95%;
        max-height: 80vh;
    }

    .product-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .product-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* ============================================
   BREADCRUMBS MOBILE
   ============================================ */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 10px 0;
        overflow-x: auto;
        white-space: nowrap;
    }

    .breadcrumb-item {
        display: inline;
    }
}

/* ============================================
   COMPARISON TABLE MOBILE
   ============================================ */
@media (max-width: 768px) {
    .comparison-section {
        padding: 20px 15px;
        border-radius: 12px;
    }

    .comparison-title {
        font-size: 1.3rem;
    }

    .comparison-header,
    .comparison-row {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 8px;
    }

    .comparison-cell {
        font-size: 0.75rem;
        padding: 8px 6px;
    }

    .feature-cell svg {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   SAFE AREA (notch) support
   ============================================ */
@supports (padding: max(0px)) {
    .site-header {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    .site-footer {
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }
}

/* ============================================
   TOUCH IMPROVEMENTS
   ============================================ */
@media (hover: none) {
    /* Remove hover effects on touch devices */
    .product-card:hover,
    .category-card:hover,
    .feature-card:hover {
        transform: none;
    }

    /* Add active states instead */
    .product-card:active,
    .category-card:active {
        transform: scale(0.98);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .cookie-banner,
    .menu-toggle,
    .btn-add-to-cart,
    .cart-actions {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
