/**
 * Responsive CSS for Al-Anika Store Theme
 * 
 * @package AlAnikaStore
 * @version 1.0.0
 */

/* ==========================================================================
   Mobile First Approach (320px and up)
   ========================================================================== */

/* Base Mobile Styles */
@media (min-width: 320px) {
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    /* Header Mobile */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .top-header {
        display: none; /* Hidden on mobile */
    }
    
    .header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 0;
        gap: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 24px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .mobile-menu-toggle span {
        display: block;
        height: 2px;
        width: 100%;
        background: var(--primary-color);
        border-radius: 1px;
        transition: all 0.3s;
    }
    
    .site-logo img {
        max-height: 40px;
        width: auto;
    }
    
    .header-search {
        flex: 1;
        max-width: 200px;
    }
    
    .search-input-group {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .search-field {
        width: 100%;
        padding: 0.5rem 2.5rem 0.5rem 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 25px;
        font-size: 0.875rem;
        direction: rtl;
        text-align: right;
    }
    
    .search-submit {
        position: absolute;
        left: 0.5rem;
        background: none;
        border: none;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0.25rem;
    }
    
    .header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .header-action {
        position: relative;
    }
    
    .action-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        color: var(--primary-color);
        text-decoration: none;
        border-radius: 50%;
        background: rgba(236, 72, 153, 0.1);
        transition: all 0.3s;
    }
    
    .action-link:hover {
        background: var(--primary-color);
        color: white;
    }
    
    .action-count {
        position: absolute;
        top: -8px;
        right: -8px;
        background: #ef4444;
        color: white;
        font-size: 0.75rem;
        font-weight: bold;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 20px;
        text-align: center;
    }
    
    /* Main Navigation Mobile */
    .main-navigation {
        display: none;
        background: var(--primary-color);
        padding: 0;
    }
    
    .categories-menu {
        position: relative;
    }
    
    .categories-toggle {
        width: 100%;
        padding: 1rem;
        background: rgba(255,255,255,0.1);
        border: none;
        color: white;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .main-menu {
        display: none;
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 10000;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }
    
    .mobile-menu-overlay.active {
        right: 0;
    }
    
    .mobile-overlay.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
    }
    
    .mobile-menu-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-menu-header {
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-logo img {
        max-height: 40px;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #6b7280;
    }
    
    .mobile-nav-menu {
        list-style: none;
        padding: 1rem 0;
        margin: 0;
        flex: 1;
    }
    
    .mobile-nav-menu li {
        border-bottom: 1px solid #f3f4f6;
    }
    
    .mobile-nav-menu a {
        display: block;
        padding: 1rem;
        color: #374151;
        text-decoration: none;
        font-weight: 500;
    }
    
    .mobile-nav-menu a:hover {
        background: #f9fafb;
        color: var(--primary-color);
    }
    
    .mobile-actions {
        padding: 1rem;
        border-top: 1px solid #e2e8f0;
    }
    
    .mobile-action {
        display: flex;
        align-items: center;
        padding: 0.75rem 0;
        color: #374151;
        text-decoration: none;
    }
    
    .mobile-action i {
        margin-left: 1rem;
        width: 20px;
        color: var(--primary-color);
    }
    
    .mobile-action .count {
        margin-right: auto;
        background: #ef4444;
        color: white;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.75rem;
    }
    
    /* Footer Mobile */
    .site-footer {
        background: #1f2937;
        color: white;
        margin-top: 3rem;
    }
    
    .newsletter-section {
        background: var(--primary-color);
        padding: 2rem 0;
    }
    
    .newsletter-content {
        text-align: center;
    }
    
    .newsletter-text h3 {
        margin-bottom: 0.5rem;
        font-size: 1.25rem;
    }
    
    .newsletter-text p {
        margin-bottom: 1.5rem;
        opacity: 0.9;
    }
    
    .newsletter-form .form-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-form input[type="email"] {
        padding: 0.75rem 1rem;
        border: none;
        border-radius: 25px;
        font-size: 1rem;
        text-align: center;
    }
    
    .newsletter-form button {
        padding: 0.75rem 2rem;
        background: white;
        color: var(--primary-color);
        border: none;
        border-radius: 25px;
        font-weight: bold;
        cursor: pointer;
    }
    
    .footer-main {
        padding: 2rem 0;
    }
    
    .footer-widgets {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-column h4 {
        color: white;
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    
    .footer-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer-menu li {
        margin-bottom: 0.5rem;
    }
    
    .footer-menu a {
        color: #d1d5db;
        text-decoration: none;
        font-size: 0.9rem;
    }
    
    .footer-menu a:hover {
        color: var(--primary-color);
    }
    
    .footer-bottom {
        background: #111827;
        padding: 1.5rem 0;
    }
    
    .footer-bottom-content {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .social-links {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }
    
    .social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        color: white;
        border-radius: 50%;
        text-decoration: none;
        transition: all 0.3s;
    }
    
    .social-link:hover {
        background: var(--primary-color);
        transform: translateY(-2px);
    }
    
    /* Content Area Mobile */
    .main-content {
        padding: 2rem 0;
    }
    
    .page-header {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        color: #1f2937;
        margin-bottom: 0.5rem;
    }
    
    .content-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .content-area {
        order: 1;
    }
    
    .sidebar {
        order: 2;
    }
    
    .posts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-card {
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        transition: transform 0.3s, box-shadow 0.3s;
    }
    
    .post-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    .post-thumbnail img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .post-title a {
        color: #1f2937;
        text-decoration: none;
    }
    
    .post-title a:hover {
        color: var(--primary-color);
    }
    
    .post-excerpt {
        color: #6b7280;
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .read-more {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
    }
    
    .read-more:hover {
        text-decoration: underline;
    }
    
    /* Pagination Mobile */
    .pagination-wrapper {
        margin-top: 2rem;
        display: flex;
        justify-content: center;
    }
    
    .page-numbers {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        margin: 0 2px;
        padding: 0 0.5rem;
        border: 1px solid #e5e7eb;
        background: white;
        color: #6b7280;
        text-decoration: none;
        border-radius: 4px;
        font-size: 0.9rem;
        transition: all 0.2s;
    }
    
    .page-numbers:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }
    
    .page-numbers.current {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }
}

/* ==========================================================================
   Small Mobile (476px and up)
   ========================================================================== */

@media (min-width: 476px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .header-row {
        gap: 1.5rem;
    }
    
    .header-search {
        max-width: 250px;
    }
    
    .newsletter-form .form-group {
        flex-direction: row;
        align-items: center;
    }
    
    .newsletter-form input[type="email"] {
        flex: 1;
        text-align: right;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Large Mobile (640px and up)
   ========================================================================== */

@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
        max-width: 640px;
    }
    
    /* Header Tablet+ */
    .top-header {
        display: block;
        background: #f8fafc;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .top-header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.875rem;
    }
    
    .contact-info {
        display: flex;
        gap: 1.5rem;
    }
    
    .contact-info span {
        color: #6b7280;
    }
    
    .contact-info a {
        color: var(--primary-color);
        text-decoration: none;
    }
    
    .header-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .language-selector select,
    .currency-selector select {
        border: 1px solid #e2e8f0;
        background: white;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.875rem;
    }
    
    .user-account {
        display: flex;
        gap: 1rem;
    }
    
    .user-account a {
        color: #6b7280;
        text-decoration: none;
        font-size: 0.875rem;
    }
    
    .user-account a:hover {
        color: var(--primary-color);
    }
    
    .header-row {
        padding: 1rem 0;
    }
    
    .site-logo img {
        max-height: 50px;
    }
    
    .header-search {
        max-width: 400px;
    }
    
    /* Navigation Tablet+ */
    .main-navigation {
        display: block;
        background: var(--primary-color);
    }
    
    .main-navigation .container {
        display: flex;
        align-items: center;
    }
    
    .categories-menu {
        position: relative;
        margin-left: auto;
    }
    
    .categories-toggle {
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        padding: 1rem 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        border-radius: 4px 4px 0 0;
    }
    
    .categories-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        min-width: 400px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border-radius: 0 0 8px 8px;
        z-index: 100;
        display: none;
    }
    
    .categories-dropdown.active {
        display: block;
    }
    
    .categories-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 1rem;
    }
    
    .category-item a {
        display: flex;
        align-items: center;
        padding: 1rem;
        color: #374151;
        text-decoration: none;
        border-radius: 8px;
        transition: background 0.2s;
    }
    
    .category-item a:hover {
        background: #f3f4f6;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 1rem;
    }
    
    .category-info h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .category-info span {
        font-size: 0.875rem;
        color: #6b7280;
    }
    
    .main-menu {
        flex: 1;
    }
    
    .nav-menu {
        display: flex;
        list-style: none;
        padding: 0;
        margin: 0;
        gap: 2rem;
    }
    
    .nav-menu a {
        color: white;
        text-decoration: none;
        padding: 1rem 0;
        font-weight: 500;
        transition: color 0.2s;
    }
    
    .nav-menu a:hover {
        color: #f9a8d4;
    }
    
    .nav-menu .sub-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        min-width: 200px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border-radius: 0 0 8px 8px;
        padding: 0.5rem 0;
        display: none;
        z-index: 100;
    }
    
    .nav-menu .menu-item:hover .sub-menu {
        display: block;
    }
    
    .nav-menu .sub-menu a {
        color: #374151;
        padding: 0.75rem 1rem;
        display: block;
    }
    
    .nav-menu .sub-menu a:hover {
        background: #f3f4f6;
        color: var(--primary-color);
    }
    
    /* Posts Grid Tablet */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer Tablet */
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-bottom-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
}

/* ==========================================================================
   Medium Tablets (768px and up)
   ========================================================================== */

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
    
    .header-row {
        gap: 2rem;
    }
    
    .header-search {
        max-width: 500px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* ==========================================================================
   Large Tablets (1024px and up)
   ========================================================================== */

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
    
    /* Header Desktop */
    .header-row {
        gap: 3rem;
    }
    
    .header-search {
        max-width: 600px;
    }
    
    /* Navigation Desktop */
    .categories-dropdown {
        min-width: 600px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Content Layout Desktop */
    .content-layout {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 3rem;
    }
    
    .content-area {
        order: 1;
    }
    
    .sidebar {
        order: 2;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer Desktop */
    .footer-widgets {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Large Desktop (1280px and up)
   ========================================================================== */

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    .header-search {
        max-width: 700px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .categories-dropdown {
        min-width: 800px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Extra Large Desktop (1536px and up)
   ========================================================================== */

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Ultra Wide (1920px and up)
   ========================================================================== */

@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .footer-widgets {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .mobile-menu-toggle,
    .header-actions,
    .main-navigation,
    .newsletter-section,
    .footer-bottom,
    .pagination-wrapper {
        display: none !important;
    }
    
    .site-header,
    .site-footer {
        box-shadow: none !important;
        background: white !important;
        color: black !important;
    }
    
    .post-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        margin-bottom: 1rem !important;
    }
    
    .post-thumbnail img {
        max-height: 200px !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .post-card {
        border: 2px solid #000 !important;
    }
    
    .read-more {
        text-decoration: underline !important;
    }
    
    .page-numbers {
        border: 2px solid #000 !important;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .post-card:hover {
        transform: none !important;
    }
    
    .mobile-menu-overlay {
        transition: none !important;
    }
}