/**
 * First Priority Supply Theme - Responsive Styles
 * Mobile-first responsive design
 */

/* ==================================== */
/* TABLET STYLES (768px - 1024px) */
/* ==================================== */

@media (max-width: 1024px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .header-content {
        gap: 20px;
    }

    .search-bar {
        max-width: 400px;
    }

    .products,
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .shop-layout {
        gap: 20px;
    }
}

/* ==================================== */
/* MOBILE STYLES (max-width: 768px) */
/* ==================================== */

@media (max-width: 768px) {
    /* Utility Bar */
    .utility-bar {
        font-size: 0.85rem;
    }

    .utility-bar .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .utility-left,
    .utility-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Top Banner */
    .top-banner {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

    /* Header */
    header {
        padding: 15px 0;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: space-around;
        gap: 15px;
    }

    .header-action {
        font-size: 0.8rem;
    }

    .header-action-icon {
        font-size: 1.3rem;
    }

    /* Navigation */
    .mobile-menu-toggle {
        display: block;
        width: 100%;
        text-align: left;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--secondary);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a {
        padding: 15px 20px;
    }

    .nav-links .sub-menu {
        position: static;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2);
        display: none;
    }

    .nav-links li:hover > .sub-menu {
        display: block;
    }

    .nav-links .sub-menu a {
        color: rgba(255, 255, 255, 0.9);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-left: 30px;
    }

    /* Shop Layout */
    .shop-layout {
        flex-direction: column;
        padding: 20px 0;
    }

    .sidebar {
        width: 100%;
        display: none;
    }

    .sidebar.active {
        display: block;
    }

    .filter-toggle-mobile {
        display: block;
        margin-bottom: 20px;
    }

    .filter-toggle-btn {
        width: 100%;
        background-color: var(--primary);
        color: white;
        padding: 12px;
        border: none;
        border-radius: 5px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .filter-toggle-btn:hover {
        background-color: var(--primary-dark);
    }

    /* Products Grid */
    .products,
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .product-image,
    .attachment-woocommerce_thumbnail {
        height: 180px;
    }

    .product-info {
        padding: 15px;
    }

    .product-title,
    .woocommerce-loop-product__title {
        font-size: 1rem;
    }

    .price,
    .woocommerce-Price-amount {
        font-size: 1.1rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-column {
        text-align: center;
    }

    .footer-column ul {
        text-align: center;
    }

    /* Hero Section */
    .hero-section {
        padding: 60px 20px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1.1rem;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 25px;
    }
}

/* ==================================== */
/* SMALL MOBILE STYLES (max-width: 480px) */
/* ==================================== */

@media (max-width: 480px) {
    /* Products Grid - Single Column */
    .products,
    ul.products {
        grid-template-columns: 1fr;
    }

    .product-image,
    .attachment-woocommerce_thumbnail {
        height: 220px;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    /* Buttons */
    .add_to_cart_button,
    .button {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Header Actions */
    .header-actions {
        gap: 10px;
    }

    .header-action {
        font-size: 0.75rem;
    }

    /* Search Bar */
    .search-bar input[type="search"] {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .search-bar button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Utility Bar */
    .utility-bar {
        font-size: 0.8rem;
        padding: 8px 0;
    }

    /* Pagination */
    .woocommerce-pagination a,
    .woocommerce-pagination span {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Footer */
    .site-footer {
        padding: 30px 0 15px;
    }

    .footer-column h3 {
        font-size: 1.1rem;
    }

    .footer-bottom {
        font-size: 0.85rem;
    }
}

/* ==================================== */
/* EXTRA SMALL DEVICES (max-width: 360px) */
/* ==================================== */

@media (max-width: 360px) {
    .logo {
        font-size: 1.3rem;
    }

    .top-banner {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .utility-bar {
        font-size: 0.75rem;
    }

    .product-info {
        padding: 12px;
    }

    .product-title,
    .woocommerce-loop-product__title {
        font-size: 0.95rem;
    }

    .price,
    .woocommerce-Price-amount {
        font-size: 1rem;
    }
}

/* ==================================== */
/* PRINT STYLES */
/* ==================================== */

@media print {
    .top-banner,
    .utility-bar,
    .main-nav,
    .header-actions,
    .sidebar,
    .footer-widgets,
    .add_to_cart_button,
    .mobile-menu-toggle,
    .scroll-to-top {
        display: none !important;
    }

    header {
        position: static;
        box-shadow: none;
        border-bottom: 2px solid #000;
    }

    .products,
    ul.products {
        grid-template-columns: repeat(2, 1fr);
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ==================================== */
/* ACCESSIBILITY ENHANCEMENTS */
/* ==================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ==================================== */
/* SCROLL TO TOP BUTTON */
/* ==================================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
    }
}

/* ==================================== */
/* LOADING STATES */
/* ==================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cart Count Bounce Animation */
.cart-count.bounce {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
