/*
Theme Name: Ordreportal
Description: A custom WooCommerce theme with Bootstrap 5 for ordering portal
Author: Håkon Kvalø Langtvedt / SynsDu AS
Version: 2.0
License: GPL v2 or later
Text Domain: ordreportal
*/

/* ===== THEME VARIABLES ===== */
:root {
    --primary-color: #17a2b8;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --white: #ffffff;
    --border-color: #dee2e6;
    --product-bg: #e9ecef;
    --sidebar-bg: #f8f9fa;
}

/* ===== GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
}

.container-fluid {
    padding: 0;
}

/* ===== HEADER STYLES ===== */
.site-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .cart-and-user {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
}

.site-logo {
    max-height: 50px;
    width: auto;
}

.site-logo-text h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
}

.cart-and-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-info {
    background-color: var(--primary-color);
    color: var(--white) !important;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.cart-info:hover {
    background-color: #138496;
    color: var(--white);
    text-decoration: none;
}

.cart-text {
    margin-left: 5px;
}

.user-menu .dropdown-toggle {
    white-space: nowrap;
}

/* ===== MAIN LAYOUT ===== */
#primary.content-area {
    width: 100%;
    max-width: 100%;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 100px);
    width: 100%;
    max-width: 100%;
}

.site-main {
    flex: 1;
    padding: 20px;
    background-color: var(--white);
    min-width: 0; /* Fix for flex overflow */
}

/* Legacy support */
.content-area {
    flex: 1;
  /*  padding: 20px; */
    background-color: var(--white);
    min-width: 0; /* Fix for flex overflow */
    width: calc(100% - 250px);
}

.single-product-content {
  padding: 20px; /*fix for endringen over */
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    padding: 20px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar h3 {
    color: var(--dark-gray);
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.category-list a:hover,
.category-list a.current {
    color: var(--primary-color);
    font-weight: 600;
}

.category-list .count {
    font-size: 12px;
    color: var(--secondary-color);
    margin-left: 5px;
}

/* Filter Section */
.filter-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.filter-section h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.filter-options {
    max-height: 150px;
    overflow-y: auto;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    padding-left: 25px;
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.filter-checkbox:hover input ~ .checkmark {
    background-color: var(--light-gray);
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.filter-checkbox .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.price-filter input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 8px;
    width: 100%;
    margin-bottom: 10px;
}

/* ===== PRODUCT GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background-color: var(--product-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: #a5a5a55e;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.product-price {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #138496;
}

/* ===== MOBILE STYLES ===== */
.mobile-filter-btn {
    display: none;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    cursor: pointer;
}

.mobile-filter-btn:hover {
    background-color: #138496;
}

.sidebar-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
    z-index: 10;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== BUTTONS & FORMS ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #138496;
    color: var(--white);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* ===== PAGE TEMPLATES ===== */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-header .page-title {
    font-size: 28px;
    color: var(--dark-gray);
    margin: 0;
    font-weight: 700;
}

.page-content {
    line-height: 1.6;
    color: var(--dark-gray);
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
    color: var(--dark-gray);
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-content p {
    margin-bottom: 20px;
}

.page-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.page-links a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background-color: var(--light-gray);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-links a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Welcome message for index page */
.welcome-message {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 40px;
}

.welcome-message h2 {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.welcome-message p {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 16px;
}

.content-wrapper {
    display: grid;
    gap: 30px;
}

.content-item {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.post-image {
    margin-bottom: 15px;
}

.post-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-title {
    margin-bottom: 15px;
}

.post-title a {
    color: var(--dark-gray);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-content {
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.read-more-btn:hover {
    background-color: #138496;
    color: var(--white);
    text-decoration: none;
}

.no-content {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
    margin-top: 40px;
}

.no-content h3 {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.no-content p {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* ===== WOOCOMMERCE OVERRIDES ===== */

.woocommerce .woocommerce-ordering,
.woocommerce .woocommerce-result-count {
    margin-bottom: 20px;
}

.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 280px);
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: start; /* This prevents stretching */
}

.woocommerce ul.products li.product {
    background-color: var(--product-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin: 0;
    width: 280px !important; /* Fixed width */
    max-width: 280px !important;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.woocommerce ul.products li.product .price {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.woocommerce ul.products li.product .button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #138496;
}


/* Reset button styling */
.reset_variations {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.reset_variations:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-color: var(--secondary-color);
}

.reset_variations:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.25);
}

/* Position reset button better */
.variations .value {
    position: relative;
}

.variations .value .reset_variations {
    margin-left: 10px;
    vertical-align: top;
}

/* WooCommerce messages styling */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    padding: 15px 20px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-message {
    background-color: #d4edda;
    border-left-color: var(--success-color);
    color: #155724;
}

.woocommerce-error {
    background-color: #f8d7da;
    border-left-color: var(--danger-color);
    color: #721c24;
}

.woocommerce-info {
    background-color: #d1ecf1;
    border-left-color: var(--primary-color);
    color: #0c5460;
}

/* Message links styling */
.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
}

.woocommerce-message a:hover,
.woocommerce-info a:hover,
.woocommerce-error a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Close button for messages */
.woocommerce-message .close,
.woocommerce-info .close,
.woocommerce-error .close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.woocommerce-message .close:hover,
.woocommerce-info .close:hover,
.woocommerce-error .close:hover {
    opacity: 1;
}

/* Add icon to messages */
.woocommerce-message::before {
    content: "✓";
    font-weight: bold;
    font-size: 16px;
    color: var(--success-color);
    flex-shrink: 0;
}

.woocommerce-error::before {
    content: "⚠";
    font-weight: bold;
    font-size: 16px;
    color: var(--danger-color);
    flex-shrink: 0;
}

.woocommerce-info::before {
    content: "ℹ";
    font-weight: bold;
    font-size: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Message content */
.woocommerce-message .message-content,
.woocommerce-info .message-content,
.woocommerce-error .message-content {
    flex: 1;
}

/* Notices in cart/checkout */
.woocommerce-notices-wrapper {
    margin-bottom: 20px;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error {
    margin: 10px 0;
}

/* Add to cart success message specific styling */
.wc-forward {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

.wc-forward:hover {
    background-color: #138496;
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Mobile responsive messages */
@media (max-width: 768px) {
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        padding: 12px 15px;
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .woocommerce-message::before,
    .woocommerce-info::before,
    .woocommerce-error::before {
        margin-bottom: 5px;
    }
    
    .wc-forward {
        margin-left: 0;
        margin-top: 8px;
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .reset_variations {
        display: block;
        margin-top: 10px;
        margin-left: 0;
        width: fit-content;
    }
}

@media (max-width: 480px) {
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        padding: 10px 12px;
        margin: 10px 0;
    }
    
    .reset_variations {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Category Header */
.category-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.category-header .page-title {
    font-size: 28px;
    color: var(--dark-gray);
    margin-bottom: 10px;
    font-weight: 700;
}

.category-description {
    color: var(--secondary-color);
    font-size: 16px;
    line-height: 1.6;
}

/* Shop controls */
.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.woocommerce-result-count {
    font-size: 14px;
    color: var(--secondary-color);
    margin: 0;
}

.woocommerce-ordering select {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    background-color: var(--white);
}

/* No products message */
.no-products {
    padding: 60px 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
    margin-top: 40px;
    text-align: center;
}

.no-products h3 {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.no-products p {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* WooCommerce pagination */
.woocommerce-pagination {
    text-align: center;
    margin-top: 40px;
}

.woocommerce-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.woocommerce-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.woocommerce-pagination .page-numbers.prev,
.woocommerce-pagination .page-numbers.next {
    font-weight: 600;
}

/* ===== CART & CHECKOUT LAYOUT FIXES ===== */

/* Cart layout - two column with totals on right */
.woocommerce .cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.woocommerce .woocommerce-cart-form {
    margin-bottom: 0;
}

.woocommerce .cart-collaterals {
    margin-top: 0;
    position: sticky;
    top: 20px;
}

/* Cart table improvements */
.woocommerce .shop_table {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%;
    border-collapse: collapse;
}

.woocommerce .shop_table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 14px;
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-product-gallery__trigger {
    display: none;
}

.woocommerce div.product div.images img {
    height: auto !important;
}

.woocommerce div.product .woocommerce-product-gallery {
    max-width: 90% !important;
}

  .woocommerce.archive .add_to_cart_button {
    display: none !important;
}

.product-comment-field {
    margin: 20px 0;
    width: 100%;
}

.product-comment-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.product-comment-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

/* Produktkommentarfelt styling */
.product-comment-field {
    margin: 20px 0;
    width: 100%;
}

.product-comment-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-gray);
}

.product-comment-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.product-comment-field textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.product-comment-field textarea.warning {
    border-color: var(--warning-color);
}

/* Kommentarvisning i handlekurv */
.product-comment,
.order-item-comment {
    margin-top: 5px;
    font-style: italic;
    color: var(--dark-gray);
}

.product-comment strong {
    font-weight: 600;
}

.woocommerce .shop_table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 14px;
}

/* Product thumbnail in cart */
.woocommerce .product-thumbnail {
    /*width: 80px; */
    text-align: center;
}

.woocommerce .product-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Product name */
.woocommerce .product-name {
    min-width: 200px;
}

.woocommerce .product-name a {
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 600;
}

.woocommerce .product-name a:hover {
    color: var(--primary-color);
}

/* Remove button */
.woocommerce .product-remove {
    width: 50px;
    text-align: center;
}

.woocommerce .product-remove .remove {
    color: var(--danger-color);
    font-size: 24px;
    text-decoration: none;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.woocommerce .product-remove .remove:hover {
    background-color: var(--danger-color);
    color: var(--white);
}

/* Price and subtotal */
.woocommerce .product-price,
.woocommerce .product-subtotal {
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    min-width: 100px;
}

/* Quantity input */
.woocommerce .product-quantity {
    width: 120px;
}

.woocommerce .quantity input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* Cart actions */
.woocommerce .shop_table .actions {
    background-color: var(--light-gray);
    padding: 20px;
}

.woocommerce .shop_table .coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.woocommerce .shop_table .coupon label {
    font-weight: 600;
    color: var(--dark-gray);
    white-space: nowrap;
}

.woocommerce .shop_table .coupon input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce .shop_table .button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.woocommerce .shop_table .button:hover {
    background-color: #138496;
    color: var(--white);
}

/* Custom Login Form Styling */
.login-required-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-required-container h2 {
    color: var(--dark-gray);
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
}

.login-required-container p {
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.ordreportal-login-form .form-group {
    margin-bottom: 20px;
}

.ordreportal-login-form label {
    display: block;
    color: var(--dark-gray);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.ordreportal-login-form .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: var(--white);
}

.ordreportal-login-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.ordreportal-login-form .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.ordreportal-login-form .form-check-input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.ordreportal-login-form .btn-primary {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ordreportal-login-form .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.ordreportal-login-form .form-footer {
    text-align: center;
    margin-top: 20px;
}

.ordreportal-login-form .form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.ordreportal-login-form .form-footer a:hover {
    text-decoration: underline;
}

/* Error and success messages */
.login-message {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.login-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .login-required-container {
        margin: 20px;
        padding: 20px;
    }
    
    .login-required-container h2 {
        font-size: 20px;
    }
}

/* Cart totals styling */
.woocommerce .cart_totals {
    background-color: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.woocommerce .cart_totals h2 {
    color: var(--dark-gray);
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.woocommerce .cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce .cart_totals th,
.woocommerce .cart_totals td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.woocommerce .cart_totals th {
    text-align: left;
    font-weight: 600;
    color: var(--dark-gray);
}

.woocommerce .cart_totals td {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

.woocommerce .cart_totals .order-total th,
.woocommerce .cart_totals .order-total td {
    font-size: 18px;
    font-weight: 700;
    border-bottom: none;
    padding-top: 15px;
}

/* Proceed to checkout button */
.woocommerce .wc-proceed-to-checkout {
    text-align: center;
    margin-top: 20px;
}

.woocommerce .checkout-button,
.woocommerce .wc-proceed-to-checkout .checkout-button,
.woocommerce .wc-proceed-to-checkout a {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.woocommerce .checkout-button:hover,
.woocommerce .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce .wc-proceed-to-checkout a:hover {
    background-color: #138496;
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ===== CHECKOUT FORM STYLING ===== */

/* Checkout layout */
.checkout-form-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.checkout-billing,
.checkout-order-review {
    background-color: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-billing h3,
.checkout-order-review h3 {
    color: var(--dark-gray);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-billing p {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form inputs */
.form-row .input-text,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-row .input-text:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
}

.form-row .input-text::placeholder {
    color: var(--secondary-color);
    opacity: 0.7;
}

/* Select styling */
.form-row select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Order review table */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.woocommerce-checkout-review-order-table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--dark-gray);
    text-align: left;
}

.woocommerce-checkout-review-order-table .product-name {
    font-weight: 600;
    color: var(--dark-gray);
}

.woocommerce-checkout-review-order-table .product-quantity {
    color: var(--primary-color);
    font-weight: 600;
}

.woocommerce-checkout-review-order-table .product-total {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td {
    font-weight: 600;
}

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-size: 16px;
    font-weight: 700;
    border-bottom: none;
    padding-top: 15px;
}

.woocommerce-checkout-review-order-table .order-total td {
    color: var(--primary-color);
}

/* Place order button */
.form-row.place-order {
    margin-top: 25px;
}

#place_order {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: none;
}

#place_order:hover {
    background-color: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#place_order:active {
    transform: translateY(0);
}

/* My Account Navigation */
.woocommerce-MyAccount-navigation {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.woocommerce-MyAccount-navigation li {
    margin: 0;
}

.woocommerce-MyAccount-navigation a {
    display: block;
    padding: 10px 15px;
    background-color: var(--white);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.woocommerce-MyAccount-navigation a:hover,
.woocommerce-MyAccount-navigation li.is-active a {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.woocommerce-MyAccount-content {
    background-color: var(--white);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .checkout-form-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .woocommerce .cart-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .woocommerce .cart-collaterals {
        position: static;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        z-index: 2000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-filter-btn {
        display: block;
    }
    
    .site-main,
    .content-area {
        padding: 15px;
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .cart-info .cart-text {
        display: none;
    }
    
    .cart-info::after {
        content: "Handlekurv";
    }
    
    .cart-and-user {
        gap: 10px;
    }
    
    .shop-controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    .catalog-ordering {
        width: 100%;
    }
    
    .woocommerce-ordering select {
        width: 100%;
    }
    
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .checkout-billing,
    .checkout-order-review {
        padding: 20px;
    }
    
    .form-row-first,
    .form-row-last {
        width: 100%;
        display: block;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .form-row-last {
        margin-bottom: 20px;
    }
    
    .woocommerce .shop_table th,
    .woocommerce .shop_table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .woocommerce .cart_totals {
        max-width: none;
        margin: 0;
    }
    
    .woocommerce .shop_table .coupon {
        flex-direction: column;
        align-items: stretch;
    }
    
    .woocommerce .shop_table .coupon input[type="text"] {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    /* Mobile responsive table */
    .shop_table_responsive {
        border: 0;
    }
    
    .shop_table_responsive thead {
        display: none;
    }
    
    .shop_table_responsive tr {
        border: 1px solid var(--border-color);
        margin-bottom: 15px;
        display: block;
        border-radius: 8px;
        background-color: var(--white);
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .shop_table_responsive td {
        border: none;
        display: block;
        text-align: left;
        padding: 8px 0;
        position: relative;
        padding-left: 120px;
    }
    
    .shop_table_responsive td:before {
        content: attr(data-title) ": ";
        position: absolute;
        left: 0;
        width: 110px;
        font-weight: bold;
        color: var(--dark-gray);
    }
    
    .shop_table_responsive .product-thumbnail {
        text-align: left;
    }
    
    .shop_table_responsive .product-thumbnail img {
        width: 80px;
        height: 80px;
    }
    
    .shop_table_responsive .product-remove {
        text-align: left;
    }
    
    .shop_table_responsive .actions {
        padding: 15px;
    }
    
    .woocommerce-MyAccount-navigation ul {
        flex-direction: column;
    }
    
    .woocommerce-MyAccount-navigation a {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
    
    .checkout-billing,
    .checkout-order-review {
        padding: 15px;
    }
    
    .form-row .input-text,
    .form-row select {
        padding: 10px 12px;
    }
    
    #place_order {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .shop_table_responsive td {
        padding-left: 0;
    }
    
    .shop_table_responsive td:before {
        position: static;
        width: auto;
        display: block;
        margin-bottom: 5px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-end { text-align: right; }
.d-none { display: none; }
.d-block { display: block; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Bootstrap grid classes */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
} rows */
.form-row {
    margin-bottom: 20px;
    clear: both;
}

.form-row-first,
.form-row-last {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.form-row-first {
    margin-right: 4%;
}

.form-row-wide {
    width: 100%;
}

/* Form labels */
.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 14px;
}

.form-row .required {
    color: var(--danger-color);
}

/* Form


/* ===== CART LAYOUT FIXES ===== */

/* Force cart container to be 2-column grid */
.cart-container {
    display: grid !important;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.cart-form-section {
    grid-column: 1;
}

.cart-totals-section {
    grid-column: 2;
}

/* Override any WooCommerce default styling */
.cart-container .woocommerce-cart-form {
    margin-bottom: 0 !important;
    width: 100% !important;
}

.cart-container .cart-collaterals {
    margin-top: 0 !important;
    width: 100% !important;
}

.cart-container .cart_totals {
    position: sticky;
    top: 20px;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Make sure the cart totals button spans full width */
.cart-container .wc-proceed-to-checkout {
    width: 100%;
}

.cart-container .wc-proceed-to-checkout .checkout-button {
    width: 100%;
    display: block;
    text-align: center;
}

/* Responsive design for cart */
@media (max-width: 1024px) {
    .cart-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .cart-form-section {
        grid-column: 1;
        order: 1;
    }
    
    .cart-totals-section {
        grid-column: 1;
        order: 2;
    }
    
    .cart-container .cart_totals {
        position: static;
    }
}

/* Override any conflicting WooCommerce styles */
.woocommerce .cart-container,
.woocommerce-page .cart-container {
    display: grid !important;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .woocommerce .cart-container,
    .woocommerce-page .cart-container {
        grid-template-columns: 1fr !important;
    }
}



/* 1) Skjul "Legg i kurv" på arkiv/kategorisider – CSS backup i tilfelle temaet har egen markup */
.post-type-archive-product .product-actions .add-to-cart-btn,
.tax-product_cat .product-actions .add-to-cart-btn,
.post-type-archive-product a.button.add_to_cart_button,
.tax-product_cat a.button.add_to_cart_button {
    display: none !important;
}

/* 2) Midtstill pris på arkiv/kategori */
.post-type-archive-product .product-price,
.tax-product_cat .product-price {
    text-align: center;
}

/* Forelder må være relativ for at badgen skal kunne plasseres absolutt */
ul.products li.product,
li.product-card,
li.product {
    position: relative;
}

/* 3) Badge-stil på produktkort i arkiv/kategori */
.tsas-product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 99;
    display: inline-block;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    background: #ffe200;
    color: #000;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    pointer-events: none;
}

/* Sikre at omslaget tillater absolutt posisjonering av badge */
li.product-card,
li.product,
ul.products li.product {
    position: relative;
}

/* 4) Fjern "kulepunkt" (bullet) foran fraktvalg i KASSEN */
.woocommerce-checkout ul.woocommerce-shipping-methods {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

/* (Valgfritt) juster label/linjehøyde i fraktliste i kassen */
.woocommerce-checkout ul.woocommerce-shipping-methods li label {
    display: inline-block;
    margin-left: 6px;
    line-height: 1.3;
}


/* WooCommerce: fiks paginering som har blitt vertikal */
.woocommerce-pagination .page-numbers {
    list-style: none;      /* fjern bullets */
    padding: 0;
    margin: 0;
    display: flex;         /* legg dem på linje */
    gap: 8px;              /* liten avstand mellom knappene */
}

.woocommerce-pagination .page-numbers li {
    display: inline-flex;  /* sørger for horisontal layout */
    align-items: center;
}

.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: inline-flex;  /* konsistent klikkområde */
    align-items: center;
    justify-content: center;
    min-width: 36px;       /* valgfritt – gir like «knapper» */
    height: 36px;
}



.woocommerce-error {
  display: none;
}


/* Egen stil for det hardkodede menypunktet */
.sidebar .product-cats .cat-item--info a {
  display: block;
  margin-top: .5rem;
  padding: .6rem .8rem;
  border-radius: .5rem;
  background: #f3f0ff;   /* lys lilla bakgrunn */
  color: #5f3dc4;        /* lilla tekst */
  font-weight: 600;
  text-decoration: none;
}
.sidebar .product-cats .cat-item--info a:hover {
  background: #e5dbff;
}