/*
 * Jultomtens Verkstad - Main CSS File
 * Includes Fira Sans typography and public site styles
 */

/* Import Fira Sans (base) and Lilita One (brand display) from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@100..900&family=Lilita+One&display=swap');

/* CSS Variables */
:root {
    /* Brand palette */
    --brand-red: #B02314;    /* deep red */
    --brand-orange: #E4570A; /* orange-red */
    --brand-gold: #F1B33B;   /* golden yellow */
    --brand-peach: #F4C787;  /* light peach */
    --brand-cream: #FFF3D6;  /* warm cream */

    /* Map framework colors */
    --primary-color: var(--brand-red);
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Typography */
    --font-family-base: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-brand: 'Lilita One', 'Cooper Black', Impact, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
}

/* Base Typography */
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--brand-cream);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: 600;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    font-family: var(--font-family-brand);
    color: var(--brand-red);
}

/* Hero Section */
.hero-section {
    background-color: var(--brand-red);
    color: white;
    padding: 4rem 0;
}

.hero-section h1 {
    font-weight: 700;
    font-size: 3rem;
}

.hero-section p {
    font-weight: 300;
    font-size: 1.25rem;
}

/* Product Cards */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: 100%;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.product-title {
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.4;
}

.product-description {
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Price Display */
.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
    font-family: var(--font-family-base);
}

.original-price {
    text-decoration: line-through;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 400;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    width: fit-content;
}

/* Search */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-weight: 400;
}

.search-suggestion:hover {
    background-color: #f8f9fa;
}

.search-suggestion strong {
    font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    font-weight: 400;
}

.breadcrumb-item a {
    font-weight: 500;
}

/* Category Cards */
.category-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
    border-radius: 12px;
    overflow: hidden;
}

.category-card:hover {
    color: inherit;
    transform: translateY(-2px);
}

.category-card h5 {
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    margin-top: auto;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    font-weight: 400;
}

.footer a:hover {
    color: white;
    font-weight: 500;
}

.footer h5 {
    font-weight: 600;
    color: white;
}

/* Buttons */
.btn {
    font-family: var(--font-family-base);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Brand utilities and components */
.brand-heading {
    font-family: var(--font-family-brand);
    color: var(--brand-red);
    letter-spacing: 0.5px;
}

.btn-brand {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.btn-brand:hover {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

.bg-cream { background-color: var(--brand-cream) !important; }
.text-brand-red { color: var(--brand-red) !important; }
.text-brand-orange { color: var(--brand-orange) !important; }
.text-brand-gold { color: var(--brand-gold) !important; }
.bg-brand-red { background-color: var(--brand-red) !important; }
.bg-brand-orange { background-color: var(--brand-orange) !important; }
.border-brand-gold { border-color: var(--brand-gold) !important; }

/* Forms */
.form-control {
    font-family: var(--font-family-base);
    font-weight: 400;
    border-radius: 8px;
}

.form-label {
    font-weight: 500;
}

/* Utility Classes for Images */
.product-image-standard {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.shop-logo-large {
    max-height: 100px;
    max-width: 200px;
    object-fit: contain;
}

.shop-logo-medium {
    max-height: 80px;
    max-width: 150px;
    object-fit: contain;
}

.shop-logo-placeholder {
    height: 100px;
    width: 200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.shop-logo-placeholder-medium {
    height: 80px;
    width: 150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Search Results */
.search-hero {
    background-color: var(--brand-red);
    min-height: 150px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.search-hero h1 {
    font-weight: 600;
    font-size: 2.5rem;
}

.search-hero .search-icon {
    font-size: 6rem;
    opacity: 0.25;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .search-hero h1 {
        font-size: 1.8rem;
    }
    
    .search-hero .search-icon {
        font-size: 4rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .search-hero h1 {
        font-size: 1.5rem;
    }
    
    .search-hero .search-icon {
        font-size: 3rem;
    }
}

/* Performance Optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

/* Critical CSS for above-the-fold content */
.hero-section, .navbar {
    will-change: transform;
}

/* Container max-width for ultrawide monitors */
.container {
    max-width: 1400px !important;
}

/* Button hover effects */
.btn {
    transform: translateY(0);
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Card hover effects enhancement */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(0,123,255,0.3);
}

/* Loading spinner for AJAX */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Smooth transitions for specific elements */
.product-card, .category-card, .shop-card {
    transition: all 0.2s ease-in-out;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Reduce logo size on mobile */
    .navbar-brand img {
        max-height: 60px !important;
    }
    
    /* Make hamburger menu icon visible against green background */
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
    
    .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    }
    
    /* Reduce product image height on mobile */
    .product-image-container {
        min-height: 40vh !important;
    }
    
    .product-image-container img {
        max-height: 35vh !important;
    }
    
    /* Hide breadcrumb on mobile */
    .breadcrumb,
    nav[aria-label="breadcrumb"] {
        display: none !important;
    }
}
