/**
 * Responsive Styles
 *
 * @package EarphonesShop
 */

/* =========================
   MOBILE & TABLET STYLES
   ========================= */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-headline {
        font-size: 36px;
    }

    .section {
        padding: 60px 0;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {

    /* Container */
    .container {
        padding: 0 20px;
    }

    /* Typography */
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    /* Sections */
    .section {
        padding: 40px 0;
    }

    .section-large {
        padding: 60px 0;
    }

    .section-small {
        padding: 20px 0;
    }

    /* Grids */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Header */
    .site-header {
        padding: 16px 0;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .main-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        flex-direction: column;
        gap: 4px;
    }

    .hamburger-line {
        width: 24px;
        height: 2px;
        background-color: var(--color-dark);
        transition: all var(--transition-fast);
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 280px;
        height: 100vh;
        background-color: var(--color-white);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-normal);
        z-index: var(--z-fixed);
        overflow-y: auto;
    }

    .mobile-menu.active {
        right: 0;
    }

    .mobile-menu-content {
        padding: var(--spacing-xl);
    }

    .mobile-menu-close {
        position: absolute;
        top: 16px;
        right: 16px;
        background: none;
        border: none;
        font-size: 32px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-menu {
        list-style: none;
        padding: 0;
        margin-top: 40px;
    }

    .mobile-nav-menu li {
        margin-bottom: var(--spacing-md);
    }

    .mobile-nav-menu a {
        display: block;
        padding: var(--spacing-sm);
        font-size: 18px;
        color: var(--color-dark);
        text-decoration: none;
    }

    /* Hero Section */
    .hero-section {
        min-height: 70vh;
        padding: 60px 0;
    }

    .hero-headline {
        font-size: 32px;
    }

    .hero-subheadline {
        font-size: 16px;
    }

    .hero-cta-group {
        flex-direction: column;
        gap: 12px;
    }

    .hero-cta-group .btn {
        width: 100%;
    }

    .trust-badges-hero {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }

    .card-title {
        font-size: 16px;
    }

    /* Buttons */
    .btn-full-mobile {
        width: 100%;
    }

    /* Footer */
    .footer-widgets .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-column {
        margin-bottom: var(--spacing-xl);
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    /* Single Review */
    .review-hero .grid-2 {
        grid-template-columns: 1fr;
    }

    .product-info-sticky {
        position: static;
    }

    .product-info-card {
        margin-top: var(--spacing-lg);
    }

    .affiliate-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .affiliate-buttons .btn {
        width: 100%;
    }

    .pros-cons-section .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Search Modal */
    .search-modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }

    .search-field {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Tables */
    .specs-table {
        font-size: 14px;
    }

    .specs-table th,
    .specs-table td {
        padding: 8px;
    }

    /* Hide elements on mobile */
    .hidden-mobile {
        display: none !important;
    }

    .visible-mobile {
        display: block;
    }
}

/* Extra small mobile (< 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    .hero-headline {
        font-size: 28px;
    }

    .card {
        padding: 16px;
    }

    .container {
        padding: 0 16px;
    }
}

/* =========================
   HEADER COMPONENTS
   ========================= */

@media (max-width: 768px) {
    .site-branding {
        max-width: 200px;
    }

    .site-tagline {
        display: none;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .btn-header-cta {
        display: none;
    }

    .search-toggle {
        width: 40px;
        height: 40px;
        padding: 8px;
        background: none;
        border: none;
        cursor: pointer;
    }
}

/* =========================
   MODAL & OVERLAY STYLES
   ========================= */

.search-modal,
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.search-modal.active,
.mobile-menu.active {
    display: flex;
}

.search-modal-content {
    background-color: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    position: relative;
}

.search-close,
.mobile-menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--color-dark);
}

/* =========================
   STICKY ELEMENTS
   ========================= */

@media (min-width: 769px) {
    .site-header.sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        box-shadow: var(--shadow-sm);
        z-index: var(--z-sticky);
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .product-info-sticky {
        position: sticky;
        top: 100px;
    }
}

/* =========================
   RATING STARS
   ========================= */

.rating-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 20px;
}

.star {
    color: var(--color-accent);
}

.star-empty {
    color: var(--color-gray-light);
}

.star-half {
    background: linear-gradient(90deg, var(--color-accent) 50%, var(--color-gray-light) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================
   PROS / CONS
   ========================= */

.pros-list,
.cons-list {
    list-style: none;
    padding: 0;
}

.pros-list li::before {
    content: '✓ ';
    color: var(--color-success);
    font-weight: bold;
    margin-right: 8px;
}

.cons-list li::before {
    content: '✗ ';
    color: var(--color-error);
    font-weight: bold;
    margin-right: 8px;
}

/* =========================
   LOADING & ANIMATIONS
   ========================= */

.loading-spinner {
    border: 4px solid var(--color-neutral-light);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* =========================
   PRINT STYLES
   ========================= */

@media print {

    .mobile-menu,
    .search-modal,
    .site-header,
    .site-footer,
    .affiliate-buttons,
    .related-reviews-section,
    .load-more-btn,
    .newsletter-form {
        display: none !important;
    }

    .product-info-sticky {
        position: static !important;
    }

    a[href]:after {
        content: none !important;
    }
}

/* =========================
   DESKTOP NAVIGATION FIX
   ========================= */

/* Ensure navigation shows on desktop screens */
@media (min-width: 1025px) {
    .main-navigation {
        display: flex !important;
    }

    .nav-menu,
    #primary-menu {
        display: flex !important;
        flex-direction: row !important;
        list-style: none !important;
    }
}