@media only screen and (min-width: 768px) and (max-width: 1024px) {
    .cart-summary {
        width: 100% !important;
        float: none !important;
        z-index: 10;
    }
    .form-cart {
        float: none !important;
        width: 100% !important;
    }

    .block-minicart {
        width: 50% !important;
    }
}

.page-wrapper {
    background: var(--mc-page-background, #f9f9f9);
}

.block-search,
.minicart-wrapper {
    margin-top: 11px;
}

.minicart-wrapper .action.showcart:before {
    color: var(--mc-minicart-color, #757575) !important;
}

.minicart-wrapper .action.showcart:hover:before {
    color: var(--mc-minicart-color-hover, #333333) !important;
}

.block-minicart {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 500px !important;
    min-width: 20% !important;
    box-shadow: 0 10px 10px #000 !important;
    -webkit-box-shadow: 0 10px 10px #000 !important;
    -moz-box-shadow: 0 10px 10px #000 !important;
}

.minicart-items-wrapper #mini-cart {
    margin-bottom: 3em !important;
}

.minicart-multishipping.secondary {
    margin-bottom: 20px;
    border-top: 1px solid #e9e9e9;
    padding-top: 10px;
}

.duplicate-item {
    float: right;
    margin-top: 10px;
}

.duplicate-item-container {
    float: right;
    margin-bottom: 10px;
}

.cart-button-link {
    text-align: center;
    margin-top: 10px;
}

.block-cart-failed .actions.main .continue,
.block-cart-failed .actions.main .clear,
.cart-container .form-cart .actions.main .continue,
.cart-container .form-cart .actions.main .clear {
  display: inline-block !important;
}

/* =============================================
   MC CART — top action buttons
   ============================================= */

.mc-cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 28px;
}

.mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    transition: background .15s, color .15s, border-color .15s;
}

.mc-btn--ghost {
    background: none;
    border: none;
    color: #6b7280;
}

.mc-btn--ghost:hover {
    color: #111827;
}

.mc-btn--outline {
    background: none;
    border: 1px solid #d1d5db;
    color: #374151;
}

.mc-btn--outline:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

body.mc-cart-is-updating {
    cursor: wait;
}

body.mc-cart-is-updating::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(255,255,255,.58);
    backdrop-filter: blur(1px);
    pointer-events: auto;
}

body.mc-cart-is-updating::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100001;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 4px solid #dbeafe;
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: mc-cart-spin .75s linear infinite;
    pointer-events: none;
}

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

/* =============================================
   MC CART SUMMARY
   ============================================= */

.cart-summary {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    padding: 28px;
}

.cart-summary > .summary.title {
    display: block;
    margin: 0 0 20px;
    color: #111827;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 20px;
}

.cart-summary .block.shipping,
.cart-summary .block.discount {
    display: none;
}

.cart-summary #cart-totals,
.cart-summary .cart-totals,
.cart-summary .table-wrapper {
    margin: 0;
}

.cart-summary .cart-totals {
    border-top: 0;
    padding-top: 0;
}

.cart-summary .data.table.totals {
    width: 100%;
    margin: 0;
    border: 0;
}

.cart-summary .table-caption {
    display: none;
}

.cart-summary .data.table.totals tbody,
.cart-summary .data.table.totals tr,
.cart-summary .data.table.totals th,
.cart-summary .data.table.totals td {
    border: 0;
    background: none;
}

.cart-summary .data.table.totals th,
.cart-summary .data.table.totals td {
    padding: 9px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 400;
}

.cart-summary .data.table.totals .amount {
    text-align: right;
    white-space: nowrap;
}

.cart-summary .data.table.totals .price {
    color: #111827;
}

.cart-summary .data.table.totals .grand.totals th,
.cart-summary .data.table.totals .grand.totals td {
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
    color: #111827;
    font-size: 18px;
}

.cart-summary .data.table.totals .grand.totals strong {
    font-weight: 700;
}

.cart-summary .checkout-methods-items {
    display: grid;
    gap: 14px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.cart-summary .checkout-methods-items .item {
    margin: 0;
}

.cart-summary .checkout-methods-items .action.primary.checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: #0f2741;
    box-shadow: 0 6px 14px rgba(15,39,65,.18);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.cart-summary .checkout-methods-items .action.primary.checkout::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cart-summary .checkout-methods-items .action.primary.checkout:hover {
    background: #12304f;
}

.cart-summary .action.multicheckout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #0b65bd;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.cart-summary .action.multicheckout:hover {
    color: #084f95;
    text-decoration: none;
}

/* =============================================
   MC CART ITEMS — BEM layout
   ============================================= */

/* 4 columns: info | pris | antall | (sum+slett) */
.mc-cart-header,
.mc-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 170px 160px;
    gap: 0 20px;
}

.mc-cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Column header row */
.mc-cart-header {
    padding: 0 28px 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    align-items: end;
}

.mc-cart-header span:last-child {
    text-align: right;
}

/* Card */
.mc-cart-item {
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    /* options-row and messages rows should not be stretched */
    grid-template-rows: auto auto auto;
}

.mc-cart-item.is-updating {
    opacity: .72;
}

.mc-cart-item__options-row,
.mc-cart-item__messages {
    align-self: start;
}

/* Media + info combined in first column */
.mc-cart-item__info-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.mc-cart-item__media {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-cart-item__media img,
.mc-cart-item__media .product-image-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mc-cart-item__thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.mc-cart-item__info {
    min-width: 0;
}

.mc-cart-item__name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    overflow-wrap: break-word;
    word-break: break-word;
}

.mc-cart-item__name a {
    color: inherit;
    text-decoration: none;
}

.mc-cart-item__name a:hover {
    text-decoration: underline;
}

/* Options row */
.mc-cart-item__options-row {
    grid-column: 1 / -1;
    padding-top: 12px;
    margin-top: 4px;
}

.mc-cart-item__messages {
    grid-column: 1 / -1;
}

/* Options dl */
.mc-cart-item__options {
    font-size: 13px;
    color: #4b5563;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    row-gap: 3px;
    margin: 0;
}

.mc-cart-item__options dt {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.mc-cart-item__options dt::after { content: ':'; }

.mc-cart-item__options dd {
    margin: 0;
}

.mc-cart-item__bundle-options {
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mc-cart-item__bundle-options li {
    position: relative;
    padding-left: 16px;
    line-height: 1.35;
}

.mc-cart-item__bundle-options li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6b7280;
}

.mc-cart-item__bundle-options .price {
    color: #374151;
    font-weight: 500;
}

/* Explicit grid placement — row 1 */
.mc-cart-item__info-wrap    { grid-column: 1; grid-row: 1; }
.mc-cart-item__price        { grid-column: 2; grid-row: 1; }
.mc-cart-item__qty          { grid-column: 3; grid-row: 1; }
.mc-cart-item__subtotal-wrap { grid-column: 4; grid-row: 1 / -1; }

/* Options and messages — row 2, indented to align with product name */
.mc-cart-item__options-row,
.mc-cart-item__messages     { grid-column: 1 / 4; grid-row: 2; padding-left: calc(88px + 20px); }

/* Price */
.mc-cart-item__price {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

/* Qty — hide browser spinner on number input */
.mc-cart-item__qty {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mc-cart-item__qty input.qty,
.mc-cart-item__qty select.qty {
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    width: 150px;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
}

.mc-cart-qty-stepper {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    width: 150px;
    max-width: 100%;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.mc-cart-qty-stepper__button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: #f1f5f9;
    color: #111827;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.mc-cart-qty-stepper__button:hover {
    background: #e2e8f0;
}

.mc-cart-qty-stepper__button:disabled {
    color: #cbd5e1;
    cursor: default;
}

.mc-cart-qty-stepper__button:first-child {
    border-right: 1px solid #e5e7eb;
}

.mc-cart-qty-stepper__button:last-child {
    border-left: 1px solid #e5e7eb;
}

.mc-cart-qty-stepper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.mc-cart-qty-stepper input.qty {
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    text-align: center;
}

.mc-cart-qty-stepper input.qty:focus {
    box-shadow: none;
}

.mc-cart-item__qty select.qty {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.mc-cart-item__qty input.qty:focus,
.mc-cart-item__qty select.qty:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* Hide browser number spinner arrows */
.mc-cart-item__qty input.qty::-webkit-outer-spin-button,
.mc-cart-item__qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mc-cart-item__qty input.qty[type=number] {
    -moz-appearance: textfield;
}

/* Subtotal + delete stacked in last column */
.mc-cart-item__subtotal-wrap {
    display: grid;
    grid-template-rows: 88px 1fr;
    align-items: flex-end;
    align-self: stretch;
    min-height: 88px;
}

.mc-cart-item__subtotal {
    align-self: center;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    text-align: right;
}

/* Delete button — icon only, pinned to bottom-right */
.mc-cart-item__actions {
    display: flex;
    align-items: center;
    align-self: flex-end;
    justify-self: end;
    gap: 8px;
}

.mc-cart-item__actions .action-edit {
    display: none !important;
}

.mc-cart-item__actions .action-delete {
    color: #9ca3af;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.mc-cart-item__actions .action-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

.mc-cart-item__actions .action-delete span {
    display: none;
}

/* Update button (shown by JS when qty changes) */
.mc-cart-item__update-btn {
    margin-top: 4px;
}

/* Messages */
.mc-cart-item__message {
    margin-top: 6px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
}

.mc-cart-item__message--error   { background: #fef2f2; color: #dc2626; }
.mc-cart-item__message--notice  { background: #fffbeb; color: #92400e; }
.mc-cart-item__message--success { background: #f0fdf4; color: #166534; }

/* =============================================
   Responsive — stack on mobile
   ============================================= */
@media (max-width: 767px) {
    .mc-cart-header { display: none; }

    .mc-cart-item {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 16px;
    }

    .mc-cart-item__info-wrap      { grid-column: 1 / -1; }
    .mc-cart-item__price          { grid-column: 1; }
    .mc-cart-item__qty            { grid-column: 2; }
    .mc-cart-item__subtotal-wrap  { grid-column: 1 / -1; grid-row: auto; display: flex; flex-direction: row; justify-content: space-between; align-items: center; min-height: 0; }
    .mc-cart-item__options-row    { grid-column: 1 / -1; }
    .mc-cart-item__messages       { grid-column: 1 / -1; }
    .mc-cart-item__subtotal       { text-align: left; }
    .mc-cart-qty-stepper          { width: 100%; }
    .mc-cart-item__qty input.qty,
    .mc-cart-item__qty select.qty { width: 100%; }
}

/* =============================================
   Chili group — multiple items in one box
   ============================================= */
.mc-cart-chili-group {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mc-cart-chili-group .mc-cart-item {
    border-radius: 0;
    /*border: none;*/
    box-shadow: none;
    padding: 20px 28px;
}

.mc-cart-chili-group .mc-cart-item:last-child {
    border-bottom: none;
}

/* Header-rad: bilde + navn, ingen pris/antall/sum */
.mc-cart-item--group-header {
    grid-template-columns: 1fr;
    padding-bottom: 12px;
}

.mc-cart-item--group-header .mc-cart-item__price,
.mc-cart-item--group-header .mc-cart-item__qty,
.mc-cart-item--group-header .mc-cart-item__subtotal-wrap {
    display: none;
}

/* Vanlige rader i gruppen: ingen bilde/navn, bare opsjon/pris/antall/sum */
.mc-cart-item--group-row {
    grid-template-columns: minmax(0, 1fr) 130px 170px 160px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.mc-cart-item--group-row .mc-cart-item__info-wrap {
    display: none;
}

/* Opsjon-label i kolonne 1 rad 1 for group-row, innrykket til produktnavn-nivå */
.mc-cart-item--group-row .mc-cart-item__row-label {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding-left: calc(88px + 20px);
    font-size: 14px;
    color: #4b5563;
}

.mc-cart-item--group-row .mc-cart-item__options-row {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 0;
    padding-top: 0;
    margin-top: 0;
}

.mc-cart-item--group-row .mc-cart-item__messages {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 0;
}

/* Pris, antall, sum justeres til rad 1 */
.mc-cart-item--group-row .mc-cart-item__price       { grid-column: 2; grid-row: 1; }
.mc-cart-item--group-row .mc-cart-item__qty         { grid-column: 3; grid-row: 1; }
.mc-cart-item--group-row .mc-cart-item__subtotal-wrap { grid-column: 4; grid-row: 1; min-height: 0; grid-template-rows: 1fr; }

.mc-cart-item--group-row .mc-cart-item__actions { align-self: flex-end; padding-top: 24px; }

/* Edit-link in group-header info-wrap */
.mc-cart-item__edit-link,
.mc-cart-item__actions .mc-cart-item__edit-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}

.mc-cart-item__edit-link:hover,
.mc-cart-item__actions .mc-cart-item__edit-link:hover {
    color: #2563eb;
    border-color: #93c5fd;
    background: #eff6ff;
}
