/*
Theme Name: PriceCompare Pro
Theme URI: https://sakon.se
Author: Gustaf
Author URI: https://sakon.se
Description: Ett modernt WordPress-theme för prisjämförelse med WooCommerce-integration, AJAX-sökning och responsiv design.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pricecompare
Tags: e-commerce, woocommerce, price-comparison, ajax-search, responsive
*/

/* ===================================
   RESET & BASE STYLES
=================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #e91e63;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #c2185b;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   HEADER & NAVIGATION
=================================== */

.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: #f8f8f8;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
}

.header-main {
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-logo {
    flex: 0 0 auto;
}

.site-logo a {
    font-size: 28px;
    font-weight: 700;
    color: #e91e63;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.main-navigation {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 8px 0;
    display: block;
}

.main-navigation a:hover {
    color: #e91e63;
}

/* Header Search */
.header-search-form {
    flex: 0 0 350px;
    position: relative;
}

.header-search-form input[type="search"] {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-search-form input[type="search"]:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.header-search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #e91e63;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-search-form button:hover {
    background: #c2185b;
}

/* AJAX Search Results */
.ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    margin-top: 5px;
}

.ajax-search-results.active {
    display: block;
}

.ajax-search-item {
    display: flex;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.ajax-search-item:hover {
    background: #f8f8f8;
}

.ajax-search-item:last-child {
    border-bottom: none;
}

.ajax-search-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.ajax-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ajax-search-info {
    flex: 1;
}

.ajax-search-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ajax-search-price {
    font-size: 16px;
    font-weight: 700;
    color: #e91e63;
}

.ajax-search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* ===================================
   FRONT PAGE / HERO SECTION
=================================== */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    color: #fff;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.95;
}

/* Front Page Search Box */
.hero-search-form {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
}

.hero-search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 18px 25px;
    font-size: 16px;
    border-radius: 50px;
    color: #333;
}

.hero-search-form input[type="search"]:focus {
    outline: none;
}

.hero-search-form button {
    background: #e91e63;
    color: #fff;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-search-form button:hover {
    background: #c2185b;
    transform: scale(1.05);
}

/* Popular Categories */
.popular-categories {
    padding: 60px 0;
    background: #fff;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    border-color: #e91e63;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.15);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.category-card p {
    color: #666;
    font-size: 14px;
}

/* ===================================
   PRODUCT LISTINGS
=================================== */

.products-section {
    padding: 60px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
    background: #f8f8f8;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.stars {
    color: #ffc107;
}

.rating-count {
    color: #999;
}

.product-button {
    width: 100%;
    background: #e91e63;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-button:hover {
    background: #c2185b;
}

/* ===================================
   FOOTER
=================================== */

.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 20px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget {
    padding: 0;
}

.footer-widget h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: #bdc3c7;
    font-size: 14px;
}

.footer-widget a:hover {
    color: #e91e63;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #95a5a6;
}

/* ===================================
   RESPONSIVE
=================================== */

@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-search-form {
        flex: 0 0 100%;
        order: 3;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        width: 100%;
        order: 4;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .main-navigation a {
        padding: 15px 0;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .hero-search-form {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .hero-search-form input[type="search"],
    .hero-search-form button {
        border-radius: 8px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   UTILITIES
=================================== */

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

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

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

.hidden {
    display: none;
}
