/* =============================================
   Envirapack — layout.css
   Utility bar, header, hero, footer, mobilmeny, breadcrumb
   ============================================= */

/* --- Utility bar --- */
.utility-bar {
    background: var(--primary-dark);
    color: var(--text-on-dark-muted);
    font-size: 13px;
    padding: 6px 0;
}
.utility-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utility-links {
    display: flex;
    gap: 24px;
    list-style: none;
}
.utility-links a {
    color: var(--text-on-dark-muted);
    font-size: 13px;
    transition: color 0.2s;
}
.utility-links a:hover {
    color: #fff;
}

.lang-switch {
    display: flex;
    gap: 8px;
    align-items: center;
}
.lang-switch a {
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 3px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.lang-switch a:hover {
    opacity: 0.9;
}
.lang-switch a.active {
    opacity: 1;
    background: rgba(255,255,255,0.15);
    padding: 2px 4px;
}
.lang-switch a svg {
    border-radius: 2px;
}

/* --- Header --- */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    box-shadow: var(--shadow-md);
}
.site-header .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.logo {
    flex-shrink: 0;
}
.logo img {
    height: 40px;
    width: auto;
}
.logo-text {
    color: var(--text-on-dark);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.search-bar {
    flex: 1;
    max-width: 560px;
    position: relative;
}
.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    background: rgba(255,255,255,0.1);
    color: var(--text-on-dark);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.search-bar input::placeholder {
    color: var(--text-on-dark-muted);
}
.search-bar input:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
}
.search-submit {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-on-dark-muted);
    transition: color 0.2s;
}
.search-submit:hover {
    color: #fff;
}
.search-submit svg {
    width: 18px;
    height: 18px;
}

.search-bar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    cursor: pointer;
    background-color: #fff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6L18 18M6 18L18 6' stroke='black' stroke-width='2.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
            
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.header-btn {
    color: var(--text-on-dark);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.header-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.header-btn svg {
    width: 20px;
    height: 20px;
}

.header-nav-link {
    font-size: 13px;
    opacity: 0.8;
}
.header-nav-link:hover {
    opacity: 1;
}

.cart-count {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.menu-toggle {
    display: none;
    color: var(--text-on-dark);
    padding: 8px;
}
.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.search-toggle {
    display: none;
    color: var(--text-on-dark);
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}
.search-toggle svg {
    width: 22px;
    height: 22px;
}

/* --- Hero --- */
.hero {
    background: var(--primary);
    padding: 64px 0 72px;
    position: relative;
    overflow: hidden;
}
.hero .container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.hero-row {
    display: flex;
    align-items: center;
    gap: 48px;
}
.hero-content {
    flex: 1;
    max-width: 520px;
}
.hero h1 {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-on-dark);
}
.hero p {
    color: var(--text-on-dark-muted);
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 28px;
}
.hero-image {
    flex: 0 0 auto;
    max-width: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--primary-light);
}
.hero-image img,
.hero-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Breadcrumb --- */
.breadcrumb {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    font-size: 13px;
}
.breadcrumb a {
    color: var(--text-light);
}
.breadcrumb a:hover {
    color: var(--primary);
}
.breadcrumb-sep {
    margin: 0 8px;
    color: var(--text-light);
}
.breadcrumb span:last-child {
    color: var(--text);
    font-weight: 500;
}

/* --- Page header --- */
.page-header {
    padding: 32px 0 24px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}
.page-header p {
    font-size: 15px;
    color: var(--text-light);
}

/* --- Mobilmeny overlay --- */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-dark);
    z-index: 200;
    padding: 80px 24px 24px;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
}
.mobile-nav.open {
    display: flex;
}
.mobile-nav-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #fff;
    padding: 8px;
}
.mobile-nav-close svg {
    width: 28px;
    height: 28px;
}
.mobile-nav a {
    color: var(--text-on-dark);
    font-size: 20px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: block;
}
.mobile-nav a:hover {
    color: var(--accent);
}

/* --- Footer --- */
.site-footer {
    background: var(--primary-dark);
    color: var(--text-on-dark-muted);
    padding: 48px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
}
.footer-col h4 {
    color: var(--text-on-dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 8px;
}
.footer-col a {
    color: var(--text-on-dark-muted);
    font-size: 14px;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: #fff;
}
.footer-certs {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.footer-certs img {
    height: 100px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.footer-certs img:hover {
    opacity: 1;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
}
.footer-bottom a {
    color: var(--text-on-dark-muted);
}
.footer-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-on-dark-muted);
}
.footer-contact span {
    padding: 0 16px;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.footer-contact span:last-child {
    border-right: none;
}
.footer-contact a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-contact a:hover {
    color: #fff;
}
.footer-legal {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-on-dark-muted);
    opacity: 0.85;
    text-align: center;
}

.footer-privacy {
    font-size: 13px;
    color: var(--text-on-dark-muted);
    text-align: center;
}
.footer-privacy a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-privacy a:hover {
    color: #fff;
    text-decoration: underline;
}
/* --- Varukorg overlay --- */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(98, 142, 140, 0.35);
    z-index: 150;
}
.cart-overlay.open {
    display: block;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: rgba(187, 198, 201, 0.90);
    z-index: 151;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
}
.cart-panel.open {
    right: 0;
}

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.cart-panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}
.cart-panel-close {
    color: var(--text-light);
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
}
.cart-panel-close:hover {
    color: var(--text);
}

.cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-panel-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--text-light);
}
.cart-panel-empty svg {
    margin-bottom: 12px;
    color: var(--border);
}

.cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}
.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cart-item-info {
    flex: 1;
    min-width: 0;
}
.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}
.cart-item-spec {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-item-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}
.cart-item-qty button:hover {
    background: var(--border);
}
.cart-item-qty span {
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}
.cart-item-price {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.cart-item-remove {
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 0;
    margin-top: 4px;
}
.cart-item-remove:hover {
    color: #dc3545;
}

.cart-panel-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.cart-panel-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
}
.cart-panel-total strong {
    font-size: 18px;
}
.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-bottom: 8px;
}
.cart-continue-btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

/* --- Kassa (checkout i varukorgs-panelen) --- */
.cart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.cart-back-link:hover {
    color: var(--accent);
}

.cart-checkout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.cart-checkout-item:last-of-type {
    border-bottom: none;
}
.cart-checkout-item img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    object-fit: contain;
    background: var(--bg);
    flex-shrink: 0;
}
.cart-checkout-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cart-checkout-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.cart-checkout-item-detail {
    font-size: 12px;
    color: var(--text-light);
}
.cart-checkout-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

.cart-checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    margin-bottom: 8px;
    border-top: 2px solid var(--border);
    font-size: 15px;
}
.cart-checkout-total strong {
    font-size: 17px;
    color: var(--primary);
}

.cart-checkout-section {
    margin-bottom: 16px;
}
.cart-checkout-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.cart-checkout-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.cart-checkout-select:focus {
    border-color: var(--primary);
}
.cart-checkout-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.cart-checkout-input:focus {
    border-color: var(--primary);
}

/* --- Bekräftelse --- */
.cart-confirmation {
    text-align: center;
    padding: 40px 0 20px;
}
.cart-confirmation-icon {
    color: var(--primary);
    margin-bottom: 16px;
}
.cart-confirmation-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}
.cart-confirmation-ordernr {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}
.cart-confirmation-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

/* =============================================
   Responsiv — layout
   Brytpunkter:
     1024px = hero växlar till mobillayout (en video, centrerad)
      768px = utility-bar/sökruta döljs, hamburgermeny visas, footer staplas
      480px = mindre rubrik
      360px = ännu mindre hero-padding
   ============================================= */

/* --- Hero växlar redan vid 1024px för att fungera på iPad
       och mobiler i landskap (där viewporten är 700-1024px) --- */
@media (max-width: 1024px) {
    .hero {
        padding: 48px 0 56px;
    }
    .hero .container,
    .hero-row {
        flex-direction: column;
        text-align: center;
        gap: 28px;
    }
    .hero h1 {
        font-size: clamp(28px, 7vw, 36px);
        line-height: 1.15;
    }
    .hero p {
        font-size: 16.5px;
        margin-bottom: 24px;
    }
    .hero-image {
        max-width: 280px;
        margin: 0 auto;
        aspect-ratio: 16 / 10;
    }
    .hero-row .hero-image:last-child {
        display: none;
    }
    .hero-buttons {
        justify-content: center;
    }
}

/* --- Header och footer mobilanpassas vid 768px --- */
@media (max-width: 768px) {
    .utility-bar,
    .search-bar {
        display: none;
    }

    .logo-text {
        font-size: 19px;
    }

    .header-btn span {
        display: none;
    }

    .header-actions {
        gap: 2px;
    }

    .header-btn {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .search-bar.open {
        display: block;
        position: absolute;
        top: var(--header-height);
        left: 12px;
        right: 12px;
        max-width: none;
        z-index: 99;
    }
    .search-bar.open input {
        background: var(--primary);
        box-shadow: var(--shadow-md);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-certs {
        gap: 28px;
    }
    .footer-certs img {
        height: 48px;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    /* Större tryckytor på mobil */
    .cart-item-qty button {
        width: 40px;
        height: 40px;
    }
    .cart-panel-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: clamp(24px, 8vw, 30px);
    }
}

@media (max-width: 360px) {
    .hero {
        padding: 40px 0 48px;
    }
}