/* css/style.css - Handfängsel.se (Mobile Button Fix) */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #10b981;
    --dark: #111827;
    --light: #f3f4f6;
    --text: #374151;
    --white: #ffffff;
}

/* VIKTIGT: Detta stoppar glidandet i sidled */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* BASE ELEMENTS */
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }
main { flex: 1; }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.section { padding: 60px 0; }
.bg-light { background: var(--light); }
.bg-dark { background: var(--dark); color: var(--white); }

/* TYPOGRAPHY */
h1, h2, h3 { color: var(--dark); font-weight: 800; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 20px; }
h2 { font-size: 2rem; margin-bottom: 20px; margin-top: 40px; }
h3 { font-size: 1.5rem; margin-bottom: 15px; margin-top: 30px; }
p { margin-bottom: 20px; font-size: 1.05rem; }

/* HEADER */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 2000;
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 900; font-size: 1.5rem; letter-spacing: -1px; color: var(--dark); }
.logo span { color: var(--primary); }
.site-nav ul { display: flex; gap: 30px; }
.site-nav a { font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a.active { color: var(--primary); }

/* HERO */
.hero {
    background: linear-gradient(rgba(17,24,39,0.85), rgba(17,24,39,0.9)), url('../img/hero.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}
.hero-sub {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* BUTTONS */
.btn { display: inline-block; padding: 12px 30px; border-radius: 6px; font-weight: 600; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-buy { background: var(--accent); color: var(--white); width: 100%; text-align: center; }
.btn-buy:hover { background: #059669; }

/* PRODUCT CARDS */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.product-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    position: relative;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 5px 15px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 20px;
    text-transform: uppercase;
}
.specs li {
    font-size: 0.9rem;
    color: #6b7280;
    border-bottom: 1px solid var(--light);
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
}
.price-box { margin-top: 20px; font-size: 1.2rem; font-weight: 700; color: var(--dark); text-align: center; }

/* ARTICLE CONTENT */
.article-content { font-size: 1.1rem; }
.article-content ul { list-style: disc; margin-left: 20px; margin-bottom: 20px; }
.article-content li { margin-bottom: 10px; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    font-style: italic;
    background: var(--light);
    padding: 15px;
    margin: 20px 0;
}

/* TABLE */
table { width: 100%; border-collapse: collapse; background: var(--white); margin: 30px 0; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }

/* FIX FÖR TABELL PÅ MOBIL */
.table-responsive {
    overflow-x: auto; /* Gör att man kan scrolla tabellen i sidled */
    -webkit-overflow-scrolling: touch; /* Mjuk scroll på iPhone */
    width: 100%;
    display: block;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

/* FOOTER */
footer { background: var(--dark); color: #9ca3af; padding: 40px 0; text-align: center; font-size: 0.9rem; margin-top: auto; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }


/* --- MOBILE MENU DESIGN & FIXES --- */

/* Dölj knappen på datorer som standard */
.mobile-menu-btn { display: none; }

/* Mobilanpassning */
@media (max-width: 768px) {

    /* Justera Hero-padding */
    .hero { padding: 60px 0; }
    .hero h1 { font-size: 2.5rem; }

    /* --- FIX: STAPLA KNAPPAR PÅ MOBIL (Här är lösningen) --- */
    /* Detta gör att knapparna i Heron tar 100% bredd och hamnar under varandra */
    .hero .btn {
        display: block;
        width: 100%;
        margin: 10px 0; /* Lite luft mellan knapparna */
    }
    
    /* Centrera knappar om de ligger i en container */
    .hero div {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* Visa Hamburger-knappen */
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 2002;
        position: relative;
    }

    /* Skapa de tre strecken */
    .mobile-menu-btn span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--dark);
        margin: 5px 0;
        transition: 0.3s;
        border-radius: 2px;
    }

    /* Animation när menyn är öppen (Kryss) */
    .mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Själva menyn (Dold som standard) */
    .site-nav {
        position: absolute;
        top: 100%; /* Lägger den precis under headern */
        left: 0;
        width: 100%;
        background: white;
        border-bottom: 2px solid var(--primary);
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        display: none; /* Dölj */
        flex-direction: column;
        padding: 20px 0;
        text-align: center;
        z-index: 2001;
    }

    /* Visa menyn när javascript lägger på klassen 'open' */
    .site-nav.open { display: flex; animation: slideDown 0.3s ease-out; }

    /* Länkarna i mobilmenyn */
    .site-nav ul { flex-direction: column; gap: 20px; }
    .site-nav a { font-size: 1.1rem; display: block; padding: 15px; }
}

/* Enkel animation för menyn */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- FIX FÖR LÄSBARHET I HERO --- */
.hero h1 {
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}
.hero .hero-sub {
    color: #f9fafb !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}