/* ==========================================
   1. GRUNNSTÍLLAR (Sameiginlegt fyrir allar síður)
   ========================================== */
body { 
    font-family: Arial, sans-serif; 
    margin: auto; 
    padding: 20px; 
    background-color: #f4f4f9; 
    color: #333; 
    line-height: 1.6; 
}

h1, h2 { 
    border-bottom: 2px solid #ccc; 
    padding-bottom: 10px; 
    margin-top: 0; 
}

a { text-decoration: none; transition: color 0.2s; }

.content-box { 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    overflow: hidden; 
}

.site-title { 
    display: inline-block; 
    font-size: 32px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 30px; 
}

.site-title:hover { color: #0056b3; }

/* ==========================================
   2. HEADER OG NAV (Leit í haus)
   ========================================== */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-logo { 
    max-width: 140px; 
    height: auto; 
    display: block; 
    transition: transform 0.2s, opacity 0.2s; 
}

.nav-logo:hover { 
    transform: translateY(-2px); 
    opacity: 0.85;
}

/* Leit fyrir tölvur (Desktop) */
.top-search { 
    display: flex; 
    gap: 10px; 
    flex-grow: 1; 
}

.top-search input, .top-search select { 
    padding: 12px; 
    font-size: 16px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
}

.top-search input { flex: 1; }
.top-search select { background-color: white; cursor: pointer; }

.top-search button { 
    padding: 12px 24px; 
    font-size: 16px; 
    background-color: #0056b3; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer;
}

.top-search button:hover { background-color: #004494; }

/* Leit fyrir síma (Stækkunargler) */
.mobile-search-btn { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
}

.search-box-mobile {
    display: none;
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

.search-box-mobile.active { display: block !important; }

/* ==========================================
   3. FORSÍÐA (index.html)
   ========================================== */
.front-page-body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.main-logo {
    max-width: 350px;
    height: auto;
    margin-bottom: 90px;
    filter: drop-shadow(0px 8px 15px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.main-logo:hover { transform: scale(1.02); }

.front-search-container {
    text-align: center;
    transform: translateY(-10vh);
}

.front-search-box input, .front-search-box select {
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   4. LEITARNIÐURSTÖÐUR (results.html)
   ========================================== */
#results-list { list-style-type: none; padding: 0; }

.result-card { 
    background: white; 
    margin-bottom: 20px; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex; 
    gap: 20px;
    align-items: stretch;
}

.result-thumb { 
    width: 120px; 
    border: 1px solid #ddd; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-info { flex: 1; display: flex; flex-direction: column; }

.result-title { font-size: 20px; color: #0056b3; font-weight: bold; }

.snippet-box { 
    margin-top: 10px; 
    background-color: #f8f9fa; 
    border-left: 4px solid #0056b3; 
    padding: 12px; 
    color: #555; 
    font-size: 15px; 
}

.highlight { background-color: #fff3cd; color: #856404; padding: 2px 4px; border-radius: 3px; }

/* ==========================================
   5. BÓKAYFIRLIT (allar-simaskrarnar.html)
   ========================================== */
.book-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 30px; 
}

.book-card { 
    background: white; 
    padding: 15px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    text-align: center; 
    transition: transform 0.2s; 
}

.book-card:hover { transform: translateY(-5px); }
.book-cover { width: 100%; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 15px; }

/* ==========================================
   6. UM OKKUR (um-okkur.html)
   ========================================== */
.um-okkur-mynd {
    float: right;
    width: 250px;
    height: auto;
    margin-left: 25px;
    margin-bottom: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==========================================
   7. KAUPA BLAÐSÍÐU (kaupa-bladsidu.html)
   ========================================== */
.order-form { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.order-form input, .order-form textarea { 
    padding: 10px; 
    font-size: 16px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}

/* ==========================================
   8. FOOTER HLEKKIR
   ========================================== */
.footer-links { 
    margin-top: 60px; 
    padding-top: 20px; 
    border-top: 2px solid #ccc; 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    padding-bottom: 40px; 
}

.footer-links a { color: #0056b3; font-weight: bold; }
.footer-links a:hover { text-decoration: underline; }

/* ==========================================
   9. SNJALLTÆKI (Responsive)
   ========================================== */
@media (max-width: 768px) {
    body { padding: 15px; }
    
    /* Felur leitarboxið sem er hannað fyrir tölvur */
    .top-search {
        display: none !important;
    }

    .top-search { display: none; } /* Felum borðtölvuleit */
    .mobile-search-btn { display: block; } /* Sýnum stækkunargler */

    .um-okkur-mynd {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 20px;
    }

    .header-container { gap: 10px; }
}

/* kaupa takki*/
        .buy-btn {
            align-self: flex-end; 
            margin-top: auto;     
            display: inline-block;
            background-color: #f1f3f5;
            color: #495057;
            border: 1px solid #ced4da;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: normal;
            text-decoration: none;
            border-radius: 4px;
            transition: background-color 0.2s;
        }
        .buy-btn:hover {
            background-color: #e2e6ea;
            color: #212529;
            text-decoration: none;
        }

        /* Styling for the Sold badge */
        .sold-badge {
            align-self: flex-end;
            margin-top: auto;
            display: inline-block;
            background-color: #dc3545; /* A classic 'sold out' red */
            color: white;
            border: 1px solid #c82333;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-radius: 4px;
            cursor: not-allowed; /* Shows a 'no entry' mouse cursor */
        }

/* Leitarboxins í hausnum */
.top-search {
    display: flex;
    gap: 10px;
    max-width: 500px; /* Hér setjum við hámarkið þitt */
    margin-right: auto; /* Þetta ýtir leitarboxinu alveg til vinstri í hausnum */
}

.top-search input[type="search"] {
    width: 100%; /* Inntakið fyllir út í þessi 300px */
    min-width: 150px; /* Gott að hafa lágmark svo það verði ekki of lítið */
}