/* 
 * RESPONSIVE IMPROVEMENTS - Nino Shoe Shop
 * Допълнителни стилове за оптимално изживяване на всички устройства
 */

/* ========================================
   LOADING & ERROR STATES
   ======================================== */

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    font-size: 18px;
    color: var(--text-light);
}

.loading-spinner i {
    font-size: 32px;
    margin-right: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-message {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--secondary-color);
    text-align: center;
}

.error-message i {
    font-size: 32px;
    margin-right: 15px;
}

/* ========================================
   TABLET - 992px to 1200px
   iPad Pro, Tablets
   ======================================== */

@media (min-width: 992px) and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-icons {
        gap: 20px;
    }
    
    .logo-name {
        font-size: 28px;
    }
    
    .logo-image {
        height: 60px;
    }
}

/* ========================================
   TABLET PORTRAIT - 768px to 992px
   iPad, Tablets
   ======================================== */

@media (min-width: 768px) and (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header adjustments */
    .main-header {
        padding: 15px 0;
    }
    
    .logo-circle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .logo-name {
        font-size: 24px;
    }
    
    .logo-subtitle {
        font-size: 11px;
    }
    
    .logo-image {
        height: 55px;
    }
    
    /* Navigation */
    .main-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu {
        gap: 15px;
        padding: 0 10px;
    }
    
    .nav-menu li a {
        font-size: 13px;
        padding: 8px 15px;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Sidebar as horizontal filters */
    .sidebar {
        position: static;
        width: 100%;
        margin-bottom: 30px;
        padding: 20px;
        background: var(--light-color);
        border-radius: 12px;
    }
    
    .sidebar h3 {
        font-size: 16px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ========================================
   MOBILE LANDSCAPE - 576px to 768px
   Large Phones Landscape
   ======================================== */

@media (min-width: 576px) and (max-width: 768px) {
    /* Top banner */
    .top-banner {
        font-size: 12px;
        padding: 10px;
    }
    
    /* Header */
    .header-content {
        gap: 15px;
    }
    
    .logo-circle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .logo-name {
        font-size: 20px;
    }
    
    .logo-image {
        height: 48px;
    }
    
    .search-bar input {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }
    
    /* Hide text labels, keep only icons */
    .header-icon span:not(.badge) {
        display: none !important;
    }
    
    .header-icon i {
        font-size: 20px;
    }
    
    /* Language switcher - compact for mobile landscape */
    .language-switcher {
        padding: 6px 10px;
        gap: 4px;
    }
    
    .language-switcher .lang-flag {
        font-size: 16px;
    }
    
    .language-switcher .lang-code {
        font-size: 11px;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    /* Sorting */
    .sorting-controls {
        gap: 10px;
    }
    
    .sorting-controls select {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* ========================================
   MOBILE PORTRAIT - 320px to 576px
   Phones
   ======================================== */

@media (max-width: 576px) {
    /* Top banner */
    .top-banner {
        font-size: 11px;
        padding: 8px 10px;
        line-height: 1.4;
    }
    
    .top-banner a {
        display: block;
        margin: 5px 0 0 0;
    }
    
    /* Header */
    .main-header {
        padding: 10px 0;
    }
    
    .header-content {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .logo-name {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .logo-subtitle {
        font-size: 10px;
    }
    
    .logo-image {
        height: 42px;
    }
    
    /* Search bar - full width */
    .search-bar {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
        margin-top: 10px;
    }
    
    .search-bar input {
        padding: 10px 40px 10px 15px;
        font-size: 13px;
        border-radius: 25px;
    }
    
    .search-bar button {
        width: 35px;
        height: 35px;
    }
    
    /* Header icons - compact */
    .header-icons {
        gap: 12px;
    }
    
    .header-icon {
        gap: 3px;
    }
    
    .header-icon i {
        font-size: 18px;
    }
    
    .header-icon .badge {
        width: 16px;
        height: 16px;
        font-size: 10px;
        line-height: 16px;
    }
    
    /* Language switcher - compact for mobile */
    .language-switcher {
        padding: 5px 8px;
        gap: 3px;
    }
    
    .language-switcher .lang-flag {
        font-size: 14px;
    }
    
    .language-switcher .lang-code {
        font-size: 10px;
    }
    
    /* Navigation */
    .main-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .main-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-menu {
        gap: 8px;
        padding: 0 5px;
        justify-content: flex-start;
    }
    
    .nav-menu li a {
        font-size: 12px;
        padding: 6px 12px;
        white-space: nowrap;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 11px;
        padding: 8px 0;
    }
    
    /* Sidebar - Collapsible */
    .sidebar {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .sidebar h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .category-list {
        font-size: 13px;
    }
    
    .filters label {
        font-size: 13px;
    }
    
    .size-filter {
        gap: 8px;
    }
    
    .size-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .color-filter {
        gap: 8px;
    }
    
    .color-btn {
        width: 30px;
        height: 30px;
    }
    
    .price-filter input {
        padding: 8px;
        font-size: 13px;
    }
    
    .apply-price-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* Products section */
    .section-header h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .product-count {
        font-size: 12px;
    }
    
    /* Sorting controls */
    .sorting-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .view-toggle {
        order: -1;
        justify-content: center;
    }
    
    .sort-group {
        width: 100%;
    }
    
    .sort-group select {
        width: 100%;
        font-size: 13px;
        padding: 10px;
    }
    
    /* Products grid - option for 2 columns on slightly larger phones */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Show 2 columns on phones >= 400px */
    @media (min-width: 400px) {
        .products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .product-card {
            flex-direction: column;
        }
        
        .product-image {
            width: 100%;
            height: auto;
            aspect-ratio: 1;
        }
    }
    
    /* Product cards - horizontal layout for small phones */
    .product-card {
        display: flex;
        flex-direction: row;
        border-radius: 12px;
    }
    
    .product-image {
        width: 120px;
        min-width: 120px;
        height: 120px;
        flex-shrink: 0;
        border-radius: 12px 0 0 12px;
        overflow: hidden;
    }
    
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .product-info {
        padding: 12px;
        flex: 1;
    }
    
    .product-brand {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .product-name {
        font-size: 13px;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .product-rating {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .rating-stars i {
        font-size: 10px;
    }
    
    .rating-count {
        font-size: 10px;
    }
    
    .price-container {
        margin-bottom: 10px;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .price-old {
        font-size: 12px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .product-actions {
        gap: 8px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .btn-icon {
        width: 35px;
        height: 35px;
    }
    
    .btn-icon i {
        font-size: 14px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 20px 0;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .page-numbers {
        gap: 5px;
    }
    
    .page-numbers button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-column h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .footer-column ul li {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .contact-info li {
        font-size: 12px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .footer-bottom {
        padding: 15px 0;
        font-size: 11px;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 20px;
        border-radius: 12px;
    }
    
    .close-modal {
        font-size: 24px;
        top: 15px;
        right: 15px;
    }
    
    /* Cart modal */
    .cart-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    /* Chat button */
    .chat-button {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 20px;
    }
}

/* ========================================
   VERY SMALL DEVICES - Below 360px
   Small Phones
   ======================================== */

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .logo-name {
        font-size: 16px;
    }
    
    .logo-image {
        height: 36px;
    }
    
    .product-image-container {
        width: 100px;
        height: 100px;
    }
    
    .product-name {
        font-size: 12px;
    }
    
    .price-current {
        font-size: 14px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .main-header {
        position: relative;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .chat-button {
        bottom: 10px;
        right: 10px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .top-banner,
    .main-nav,
    .sidebar,
    .sorting-controls,
    .pagination,
    .chat-button,
    .footer {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card {
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid var(--dark-color);
    }
    
    .btn-primary,
    .btn-outline {
        border: 2px solid currentColor;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Ready for dark mode implementation */
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch-specific styles */
    .product-card:hover {
        transform: none;
    }
    
    button,
    a,
    .product-card {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
    
    /* Larger touch targets */
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
}

/* =====================================================
   MOBILE HERO EDITORIAL LOOK
   Само за мобилна версия: моден/editorial банер.
   Без glass panel и без кутии върху текста.
   Снимката остава видима, а четимостта идва от фин ляв gradient.
   ===================================================== */

@media (max-width: 576px) {
    .hero-banner {
        position: relative;
        overflow: hidden;
        min-height: 335px;
        padding: 34px 20px 30px;
        align-items: flex-start;
        background-position: 69% center;
    }

    .hero-banner::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.58) 0%,
            rgba(255, 255, 255, 0.42) 34%,
            rgba(255, 255, 255, 0.16) 61%,
            rgba(255, 255, 255, 0.00) 100%
        );
    }

    .hero-content {
        position: relative;
        z-index: 1;
        max-width: 82%;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .hero-slogan {
        display: block;
        max-width: 96%;
        margin-bottom: 14px;
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        font-family: Georgia, "Times New Roman", serif;
        font-size: clamp(25px, 6.55vw, 30px);
        font-weight: 700;
        line-height: 1.13;
        letter-spacing: -0.75px;
        color: #1e40af;
        text-shadow:
            0 1px 0 rgba(255, 255, 255, 0.72),
            0 8px 22px rgba(255, 255, 255, 0.42);
    }

    .hero-desc {
        display: block;
        max-width: 88%;
        margin-bottom: 12px;
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        font-family: var(--font-main);
        font-size: clamp(14px, 3.8vw, 15.5px);
        font-weight: 600;
        line-height: 1.42;
        letter-spacing: -0.10px;
        color: #1e40af;
        text-shadow:
            0 1px 0 rgba(255, 255, 255, 0.70),
            0 6px 18px rgba(255, 255, 255, 0.36);
    }

    .hero-address {
        display: block !important;
        width: fit-content;
        max-width: 94%;
        margin: 9px 0 10px !important;
        padding: 4px 9px !important;
        background: rgba(255, 255, 255, 0.54) !important;
        border: 1px solid rgba(30, 64, 175, 0.10);
        border-radius: 8px;
        box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
        font-size: 12px !important;
        line-height: 1.35 !important;
        font-weight: 600;
        color: #1e40af !important;
    }

    .hero-shipping {
        max-width: 94%;
        margin-bottom: 20px;
        padding: 5px 12px;
        background: rgba(255, 255, 255, 0.52);
        border-color: rgba(30, 64, 175, 0.22);
        border-radius: 999px;
        box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
        font-size: 12.5px;
        line-height: 1.35;
        font-weight: 700;
    }

    .hero-btn {
        padding: 11px 24px;
        border-radius: 999px;
        letter-spacing: 1.25px;
        font-size: 12.5px;
        background: rgba(255, 255, 255, 0.06);
    }
}

@media (max-width: 360px) {
    .hero-banner {
        min-height: 305px;
        padding: 28px 17px 26px;
        background-position: 70% center;
    }

    .hero-banner::before {
        background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.62) 0%,
            rgba(255, 255, 255, 0.44) 38%,
            rgba(255, 255, 255, 0.14) 66%,
            rgba(255, 255, 255, 0.00) 100%
        );
    }

    .hero-content {
        max-width: 86%;
    }

    .hero-slogan {
        font-size: clamp(22px, 6.3vw, 25px);
        line-height: 1.12;
        letter-spacing: -0.55px;
        margin-bottom: 11px;
    }

    .hero-desc {
        max-width: 94%;
        font-size: 13.5px;
        line-height: 1.38;
    }

    .hero-shipping {
        font-size: 12px;
    }
}

/* =====================================================
   MOBILE SHOP TOOLBAR - FINAL
   Подредба само за мобилна версия:
   1) [ Филтри ] [ Сортирай ]
   2) [ grid/list ]        Покажи: [24]
   Скрива само desktop "Сортирай по", без да маха
   "Покажи: 24/48/80" и бутоните за изглед.
   ===================================================== */

@media (max-width: 768px) {
    .mobile-filter-bar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0 15px;
        margin: 12px auto 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-filter-btn {
        min-height: 44px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 800;
        letter-spacing: 0.1px;
    }

    .sorting-controls {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 8px 15px 14px;
        padding: 10px 12px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    }

    .sorting-controls .desktop-sort-group {
        display: none !important;
    }

    .sorting-controls .view-toggle {
        order: 0;
        display: inline-flex !important;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
        margin: 0;
    }

    .sorting-controls .view-btn {
        width: 38px;
        height: 36px;
        min-width: 38px;
        border-radius: 10px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sorting-controls .items-per-page-group {
        order: 1;
        width: auto !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        margin-left: auto;
        flex: 0 1 auto;
    }

    .sorting-controls .items-per-page-group label {
        margin: 0;
        font-size: 12px;
        line-height: 1.2;
        color: #64748b;
        font-weight: 800;
        white-space: nowrap;
    }

    .sorting-controls .items-per-page-group select {
        width: auto !important;
        min-width: 70px;
        height: 36px;
        padding: 6px 26px 6px 10px;
        font-size: 13px;
        font-weight: 700;
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .mobile-filter-bar {
        gap: 8px;
        padding: 0 10px;
    }

    .sorting-controls {
        gap: 7px;
        margin-left: 10px;
        margin-right: 10px;
        padding: 9px 10px;
    }

    .sorting-controls .view-btn {
        width: 35px;
        height: 34px;
        min-width: 35px;
    }

    .sorting-controls .items-per-page-group {
        gap: 6px;
    }

    .sorting-controls .items-per-page-group label {
        font-size: 11px;
    }

    .sorting-controls .items-per-page-group select {
        min-width: 64px;
        height: 34px;
        font-size: 12px;
    }
}

