/* ------------------------------------------------------------
   Typsnittet Outfit - inbaddat i projektet
   ------------------------------------------------------------
   Hamtades tidigare fran Google Fonts vid varje sidladdning, sa
   kundskarmen tappade typsnittet nar natet lag nere. Filen ar
   variabel och bar alla vikter 300-800.
   ------------------------------------------------------------ */

@font-face {
    font-family: 'Outfit';
    src: url("fonts/Outfit-latin.woff2") format("woff2");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Outfit';
    src: url("fonts/Outfit-latin-ext.woff2") format("woff2");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg-color: #dc6587;
    --text-color: #323232;
    --card-bg: rgba(255, 255, 255, 0.95);
    --primary: #e5097f;
    --primary-hover: #b80766;
    --secondary: #5a94c0;
    --accent: #fad300;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

nav {
    display: flex;
    gap: 15px;
}

nav button {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

nav button:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

nav button.active {
    opacity: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.card h2 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 800;
}

.card p {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.5;
}

.upload-area {
    border: 2px dashed rgba(229, 9, 127, 0.3);
    border-radius: 16px;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.upload-area.dragover {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--primary);
    transform: scale(1.02);
}

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

.btn {
    display: inline-block;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(229, 9, 127, 0.3);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 127, 0.5);
}

.small-text {
    font-size: 14px;
    color: #94a3b8;
    margin: 15px 0;
}

.hidden {
    display: none !important;
}

.input-group {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

input[type="text"],
input[type="password"] {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-color);
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 9, 127, 0.2);
}

.scanner-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 10;
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(229, 9, 127, 0.3);
    border-radius: 32px;
    padding: 40px;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), 0 0 30px rgba(229, 9, 127, 0.1);
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

.result-card.has-bg-image {
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.result-card.has-bg-image .product-info-large {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.result-highlight {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 2px dashed rgba(255,255,255,0.1);
}

.location-huge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    padding: 20px 60px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(90, 148, 192, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.location-huge:hover {
    transform: scale(1.05);
}

.location-huge.error-badge {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.5);
}

.location-label {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 600;
}

.location-value {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 2px 4px 10px rgba(0,0,0,0.3);
}

.product-info-large {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.product-image-large {
    width: 200px;
    height: 200px;
    border-radius: 24px;
    object-fit: cover;
    background: #fff;
    border: 4px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.product-details-large {
    flex: 1;
    text-align: left;
    max-width: 400px;
}

.ean-text {
    background: rgba(0,0,0,0.05);
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: monospace;
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

.product-details-large h2 {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 800;
    line-height: 1.2;
}

.brand-text {
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
}

.supplier-links {
    margin-top: 10px;
    padding-top: 30px;
    border-top: 2px dashed rgba(255,255,255,0.1);
}

.supplier-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.supplier-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.google-btn {
    background: linear-gradient(135deg, #ea4335, #c5221f);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(234, 67, 53, 0.3);
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 67, 53, 0.5);
    background: linear-gradient(135deg, #f28b82, #ea4335);
}

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

.table-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

th {
    background: rgba(0,0,0,0.05);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:hover {
    background: rgba(0,0,0,0.02);
}

td.location-cell {
    font-weight: 800;
    color: var(--text-color);
}

.error-msg {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-top: 20px;
}

.success-msg {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-top: 20px;
    font-weight: 600;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.site-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .product-info-large {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .product-details-large {
        text-align: center;
    }
    .location-value {
        font-size: 48px;
    }
    .overview-header {
        flex-direction: column;
        gap: 15px;
    }
    .input-group {
        flex-direction: column;
    }
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 350px; /* Made slightly taller since we removed the 10 item limit */
    overflow-y: auto;
    z-index: 9999; /* Increased from 100 to ensure it is always on top */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: left;
}

.suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.suggestion-item:hover {
    background: rgba(229, 9, 127, 0.05);
}

.suggestion-item .suggestion-name {
    font-weight: 600;
    color: var(--text-color);
    display: block;
}

.suggestion-item .suggestion-ean {
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

/* Campaign Carousel */
.campaign-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Fit new horizontal images correctly */
    margin: 20px auto 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.5);
    background-color: transparent;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Gör att hela bilden ryms oavsett format */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

@media (max-width: 600px) {
    .campaign-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    max-width: 400px;
    width: 90%;
}

input[type="email"] {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-color);
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

input[type="email"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 9, 127, 0.2);
}

/* Badges for Vegan and Gelatin-free */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.badge-vegan {
    background: linear-gradient(135deg, #10b981, #059669);
}

.badge-gelatinfree {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.badge-chocolate {
    background: linear-gradient(135deg, #8a5a36, #5c381e);
}

.badge-licorice {
    background: linear-gradient(135deg, #444444, #1b1b1b);
}

/* Screensaver Styles */
#screensaver-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

#screensaver-overlay.hidden {
    display: none !important;
    opacity: 0;
}

.screensaver-title {
    color: #fff;
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    margin-top: 100px;
    margin-bottom: 50px;
    padding: 0 40px;
    z-index: 2;
    text-shadow: 0 4px 20px rgba(229, 9, 127, 0.8);
    animation: pulse 2s infinite;
}

.screensaver-carousel {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.screensaver-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(0.98);
}

.screensaver-slide.active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.5s ease-in-out, transform 10s ease-out; /* Subtle zoom effect */
}

.screensaver-logo {
    height: 120px;
    margin-bottom: 80px;
    z-index: 2;
    filter: drop-shadow(0 4px 15px rgba(255, 255, 255, 0.2));
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; text-shadow: 0 4px 30px rgba(229, 9, 127, 1); }
    100% { transform: scale(1); opacity: 0.9; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100000;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary);
    color: var(--text-color);
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(229, 9, 127, 0.3);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.hiding {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* Bildsök Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.image-grid-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
    overflow: hidden;
}

.image-grid-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(229, 9, 127, 0.3);
    border-color: var(--primary);
    z-index: 2;
}

.image-grid-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-location-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 10;
}

/* Image Details Overlay */
#image-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#image-details-overlay.hidden {
    display: none !important;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 100001;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(229, 9, 127, 0.8);
    transform: scale(1.1);
}

#image-details-container {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Product Brand Logo styling in search result and image details */
.product-logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.5s ease-out;
}

.product-logo-img {
    max-height: 90px;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

.product-logo-img:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 15px rgba(0,0,0,0.18));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Quantity selector buttons and number input styling */
#modal-qty-minus:hover, #modal-qty-plus:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    transform: scale(1.05);
}

#modal-qty-minus:active, #modal-qty-plus:active {
    transform: scale(0.95);
}

#modal-qty-input::-webkit-outer-spin-button,
#modal-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#modal-qty-input {
    -moz-appearance: textfield; /* Firefox */
}

/* ==========================================================================
   Kvittens och mobilanpassning — tillagt 2026-08-12
   ========================================================================== */

/* --- Stor grön bock när något är sparat (se kvittens.js) --- */

#klart-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    pointer-events: none;                 /* far aldrig blockera granssnittet */
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: klartIn 0.18s ease-out;
    padding: 20px;
}

#klart-overlay.stanger {
    animation: klartUt 0.35s ease-in forwards;
}

#klart-overlay .klart-ruta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid #10b981;
    border-radius: 28px;
    padding: clamp(22px, 6vw, 38px) clamp(28px, 8vw, 54px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    max-width: 100%;
}

#klart-overlay svg {
    width: clamp(92px, 26vw, 140px);
    height: auto;
}

#klart-overlay .klart-text {
    font-size: clamp(17px, 4.5vw, 23px);
    font-weight: 700;
    color: #059669;
    text-align: center;
    overflow-wrap: anywhere;
}

.klart-cirkel {
    fill: none;
    stroke: #10b981;
    stroke-width: 6;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    animation: ritaCirkel 0.45s ease-out forwards;
}

.klart-bock {
    fill: none;
    stroke: #10b981;
    stroke-width: 9;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: ritaBock 0.3s 0.32s ease-out forwards;
}

@keyframes klartIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes klartUt  { to   { opacity: 0; } }
@keyframes ritaCirkel { to { stroke-dashoffset: 0; } }
@keyframes ritaBock   { to { stroke-dashoffset: 0; } }

/* Den som stangt av rorelser far bocken direkt, utan animation. */
@media (prefers-reduced-motion: reduce) {
    #klart-overlay,
    #klart-overlay.stanger,
    .klart-cirkel,
    .klart-bock {
        animation: none;
    }
    .klart-cirkel,
    .klart-bock {
        stroke-dashoffset: 0;
    }
}

/* --- Mobilbredd ---------------------------------------------------------
   Problemet var inte en enda regel utan flera fasta pixelmatt som tillsammans
   blev bredare an en telefon: kortets 40 px padding, platsrutans 60 px i
   sidled och rubriken pa 36 px som inte fick brytas. Losningen ar clamp()
   pa vart och ett, sa att de krymper mjukt i stallet for att hoppa vid en
   brytpunkt — och overflow-wrap sa att ett langt produktnamn alltid bryts.  */

html {
    overflow-x: hidden;                   /* skyddsnat mot vagrat scroll */
}

.app-container {
    padding: clamp(12px, 4vw, 20px);
    min-width: 0;
}

.result-card,
.scanner-container {
    padding: clamp(18px, 5vw, 40px);
    min-width: 0;
}

.result-card {
    border-radius: clamp(20px, 5vw, 32px);
    gap: clamp(18px, 4vw, 30px);
    margin-top: clamp(20px, 5vw, 40px);
}

/* Flexbarn krymper inte under sitt innehall utan det har. Det ar den
   vanligaste orsaken till att text sticker ut ur ett flexkort. */
.result-card *,
.product-info-large,
.product-details-large {
    min-width: 0;
}

.product-details-large {
    max-width: 100%;
}

.product-details-large h2 {
    font-size: clamp(22px, 6vw, 36px);
    overflow-wrap: anywhere;              /* bryter aven ett enda langt ord */
    hyphens: auto;
}

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

.location-huge {
    padding: clamp(14px, 4vw, 20px) clamp(20px, 8vw, 60px);
    max-width: 100%;
}

.location-label {
    font-size: clamp(13px, 3.5vw, 18px);
    letter-spacing: clamp(1px, 0.8vw, 4px);
}

.location-value {
    font-size: clamp(34px, 11vw, 64px);
    overflow-wrap: anywhere;
}

.result-highlight {
    gap: clamp(12px, 3vw, 20px);
    padding-bottom: clamp(18px, 4vw, 30px);
}

/* Innehallsforteckningen har inline-stilar i app.js med max-width 600 px.
   Den behover ocksa fa bryta langa ord. */
.product-details-large div {
    overflow-wrap: anywhere;
}
