/* Fil: assets/css/base.css */
/* Innehåller all grundläggande design som används på hela webbplatsen. */

/* Import Cookie Consent Styles - Must be at top */
@import url('./cookie-consent.css');

:root {
    /* Professional butterfly-inspired color palette */
    --butterfly-primary: #2E7D32;
    --butterfly-secondary: #8E24AA;
    --butterfly-accent: #F57C00;
    --butterfly-neutral: #455A64;
    --butterfly-success: #4CAF50;
    --butterfly-warning: #FF9800;
    --butterfly-light-green: #E8F5E8;
    --butterfly-light-purple: #F3E5F5;
    --butterfly-light-amber: #FFF8E1;
    --butterfly-light-grey: #F5F5F5;
    --butterfly-dark: #212121;
    --butterfly-medium: #424242;
    --butterfly-light: #757575;
    --butterfly-white: #FFFFFF;
    --butterfly-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
    --butterfly-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --butterfly-hover-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
    --skeleton-bg: #e0e0e0; /* NYTT FÖR SKELETON */
}

/* Size selection on product cards */
.size-selection {
    background: var(--butterfly-light-grey);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(46, 125, 50, 0.1);
}

.size-buttons .size-btn {
    min-width: 40px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid var(--butterfly-primary) !important;
    color: var(--butterfly-primary) !important;
}


.size-buttons .size-btn.active {
    background-color: var(--butterfly-primary) !important;
    border-color: var(--butterfly-primary) !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--butterfly-dark);
    background: var(--butterfly-white);
    min-height: 100vh;
    line-height: 1.6;
    padding-top: 80px; /* Add space for fixed navbar */
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 85% 15%, rgba(46, 125, 50, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 15% 85%, rgba(142, 36, 170, 0.02) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
.navbar {
    background: linear-gradient(135deg, #E8F5E8 0%, #C8E6C9 50%, #A5D6A7 100%) !important;
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    color: var(--butterfly-primary) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--butterfly-medium) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    margin: 0 0.5rem;
}


/* Generella kort-stilar */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}


/* Produktkort */
.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
}
.product-card .product-image {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 15px 15px 0 0;
    aspect-ratio: 3 / 4; 
    object-fit: cover; 
    width: 100%;
    height: auto; 
}


/* Klass för riktiga produktkort för att kunna dölja dem */
.product-card-real {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.product-card-real.visible {
    visibility: visible;
    opacity: 1;
}

/* Animationer och effekter */
.loading-butterfly {
    display: inline-block;
    animation: flutter 1.5s ease-in-out infinite;
    font-size: 1.2em;
    line-height: 1;
    vertical-align: middle;
}

@keyframes flutter {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-6px) rotate(5deg) scale(1.1); }
    50% { transform: translateY(0) rotate(0deg) scale(1); }
    75% { transform: translateY(-4px) rotate(-5deg) scale(1.05); }
}

.text-gradient {
    background: linear-gradient(45deg, var(--butterfly-primary), var(--butterfly-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.butterfly-glow {
    position: relative;
    overflow: hidden;
}

.butterfly-glow::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(25deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}


@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(25deg); }
    100% { transform: translateX(100%) rotate(25deg); }
}

/* Hero Section */
.hero-image-placeholder {
    background: var(--butterfly-light-grey);
    border: 2px dashed var(--butterfly-primary);
    border-radius: 20px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}


/* Modal-stilar */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header, .modal-footer {
    border: none;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 50%, #43A047 100%);
    color: white;
    padding: 60px 0 40px 0;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(142, 36, 170, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(245, 124, 0, 0.08) 0%, transparent 50%);
    z-index: 1;
}

.footer .container {
    position: relative;
    z-index: 2;
}

.footer-title {
    color: #FFE082;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.4rem 0;
    font-size: 1rem;
}


.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}


.footer-nature {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.15;
    animation: float 10s ease-in-out infinite;
    z-index: 0;
}

.footer-nature:nth-child(1) { top: 20%; left: 10%; animation-duration: 12s; }
.footer-nature:nth-child(2) { top: 60%; right: 15%; animation-duration: 15s; animation-delay: 3s; }
.footer-nature:nth-child(3) { bottom: 30%; left: 20%; animation-duration: 10s; animation-delay: 5s; }

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(5px, 0px) rotate(-5deg); }
    75% { transform: translate(-10px, 15px) rotate(3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- Image Zoom Modal --- */
#imageZoomModal .modal-dialog {
  width: auto;
  max-width: 90%;
}
#imageZoomModal .modal-content {
  box-shadow: none;
}
#imageZoomModal .btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  opacity: 0.8;
  background-size: 0.8em;
}
#imageZoomModal .img-fluid {
    border-radius: 0.375rem;
}


/* --- FAQ Section Styling --- */
.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 12px !important;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
}
.accordion-header {
    margin: 0;
}
.accordion-button {
    font-weight: 600;
    color: var(--butterfly-dark);
    background-color: #fff;
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
    background-color: var(--butterfly-light-green);
    color: var(--butterfly-primary);
}
.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232E7D32'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* --- Back to Top Button --- */
#backToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 100;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


/* --- Skeleton Loader stilar --- */
.product-card-skeleton {
    background-color: #fff;
    border-color: #f0f0f0;
}

.skeleton {
    opacity: 0.7;
    animation: skeleton-shimmer 1.5s linear infinite forwards;
    background: var(--skeleton-bg);
    background-image: linear-gradient(90deg, var(--skeleton-bg) 0px, #f0f0f0 40px, var(--skeleton-bg) 80px);
    background-size: 600px;
    border-radius: 8px;
}

.skeleton.skeleton-image {
    aspect-ratio: 3 / 4;
    border-radius: 15px 15px 0 0;
}

.skeleton.skeleton-text {
    height: 20px;
    margin-bottom: 8px;
}

.skeleton.skeleton-text-short {
    width: 60%;
    height: 16px;
}

.skeleton.skeleton-button {
    height: 38px;
    width: 100%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -300px 0;
    }
    100% {
        background-position: 300px 0;
    }
}

/* MOBILOPTIMERING */
@media (max-width: 768px) {
    
    /* Hero-sektion mobiloptimering */
    .hero-section .row {
        flex-direction: column-reverse !important;
        min-height: auto !important;
        text-align: center;
        padding: 2rem 0;
    }
    
    .hero-section .col-lg-6:first-child {
        margin-top: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
        margin-bottom: 2rem !important;
    }
    
    .hero-image-placeholder {
        margin-bottom: 1rem;
        height: 250px;
    }
    
    /* Header optimering för mobil */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
        font-size: 1.1rem;
        background: rgba(46, 125, 50, 0.1);
        border-radius: 8px;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* Mobilmeny styling */
    .navbar-collapse {
        background: white;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        border: 1px solid rgba(46, 125, 50, 0.1);
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0;
        border-radius: 8px;
        color: var(--butterfly-dark) !important;
        background: rgba(46, 125, 50, 0.03);
        border: 1px solid rgba(46, 125, 50, 0.1);
        font-weight: 500;
        text-align: center;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(46, 125, 50, 0.1);
        color: var(--butterfly-primary) !important;
    }
    
    /* Auth links i mobilmeny */
    .auth-links {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(46, 125, 50, 0.1);
    }
    
    .guest-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .guest-links .nav-link {
        background: rgba(46, 125, 50, 0.05);
        border: 1px solid rgba(46, 125, 50, 0.1);
        border-radius: 8px;
        padding: 0.75rem;
        text-decoration: none;
        color: var(--butterfly-primary) !important;
        font-weight: 500;
        text-align: center;
    }
    
    .guest-links .btn {
        padding: 0.75rem 1.5rem;
        font-weight: 600;
    }
    
    .user-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .user-links .nav-link {
        background: rgba(46, 125, 50, 0.05);
        border: 1px solid rgba(46, 125, 50, 0.1);
        text-align: center;
        color: var(--butterfly-primary) !important;
        text-decoration: none;
        font-weight: 500;
    }
    
    .user-links .btn {
        padding: 0.75rem 1.5rem;
        font-weight: 600;
        width: 100%;
        justify-content: center;
    }
    
    .user-links .btn span {
        display: inline !important; /* Visa "Logga ut" text på mobil */
    }
    
    /* Mobil varukorg ikon bredvid hamburger */
    #mobileCartIcon {
        color: var(--butterfly-primary) !important;
        text-decoration: none;
    }
    
    #mobileCartIcon:hover {
        color: var(--butterfly-secondary) !important;
    }
    
    /* Hero sektion mobiloptimering - tvinga rätt ordning */
    .hero-section .row {
        display: flex !important;
        flex-direction: column !important;
        text-align: center;
    }
    
    /* Bild först (ordning 1) */
    .hero-section .col-lg-6:last-child {
        order: 1 !important;
        margin-bottom: 3rem;
    }
    
    /* Text och knapp efter bilden (ordning 2) */
    .hero-section .col-lg-6:first-child {
        order: 2 !important;
        margin-top: 0;
    }
    
    /* Centrera allt innehåll i hero-sektionen */
    .hero-section h1,
    .hero-section p,
    .hero-section .btn {
        text-align: center !important;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Footer nature ikoner mobiloptimering */
    .footer-nature:nth-child(1) { left: 5% !important; }
    .footer-nature:nth-child(2) { left: 15% !important; }
    .footer-nature:nth-child(3) { left: 25% !important; }
    .footer-nature:nth-child(4) { left: 35% !important; }
    .footer-nature:nth-child(5) { left: 45% !important; }
    .footer-nature:nth-child(6) { left: 55% !important; }
    .footer-nature:nth-child(7) { left: 65% !important; }
    .footer-nature:nth-child(8) { left: 75% !important; }
    .footer-nature:nth-child(9) { left: 85% !important; }
    .footer-nature:nth-child(10) { left: 95% !important; }
    
}

/* Responsiv top-margin för mobilsidor */
@media (max-width: 768px) {
    /* Alla sidor med standardlayout */
    .container[style*="margin-top: 120px"] {
        margin-top: 90px !important;
    }
    
    /* Hero-sektioner (som Om oss, FAQ) */
    .hero-section {
        padding-top: 90px !important;
    }
}

/* Extra liten skärm (phones) */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    /* Ännu mindre top-margin på små telefoner */
    .container[style*="margin-top: 120px"] {
        margin-top: 80px !important;
    }
    
    .hero-section {
        padding-top: 80px !important;
    }
    
    /* Kompaktare mobilmeny */
    .navbar-collapse {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }
}

