/* This stylesheet intentionally reuses the theme's own CSS custom properties
   (--yellow, --gray, --red_hover, --family-Viga, --family-WEB, etc.) defined in
   the theme's global styles.css :root block, since both load on the same page. */

.matrix-global-summary {
    position: sticky;
    top: 60px; /* clears the theme's sticky nav (.navShadow) */
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    color: #333;
    border: 2px solid #333;
    padding: 16px 24px;
    margin-bottom: 24px;
    font-size: 15px;
}

.matrix-global-summary .action.primary {
    background: var(--yellow, #f6d72e);
    color: #000;
    border: 2px solid var(--yellow, #f6d72e);
    padding: 9.5px 17px;
    position: relative;
    text-transform: uppercase;
    font-family: var(--family-Viga, sans-serif);
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.matrix-global-summary .action.primary::before {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    top: -8px;
    left: -8px;
    z-index: 1;
    border: 2px solid #000000;
    transition: all .5s;
    position: absolute;
    content: "";
}

.matrix-global-summary .action.primary:hover::before {
    top: -2px;
    left: -2px;
    height: 100%;
    width: 100%;
}

.matrix-product {
    border: 1px solid #e5e5e5;
    margin-bottom: 24px;
    background: #fff;
}

.matrix-product-header {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    align-items: flex-start;
}

.matrix-catalog-badge {
    margin-left: auto;
    align-self: flex-start;
    font-family: var(--family-Viga, sans-serif);
    font-size: 12px;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1px solid;
    white-space: nowrap;
}

.matrix-catalog-badge.is-current {
    color: #1a7d2c;
    border-color: #1a7d2c;
    background: #eefbf0;
}

.matrix-catalog-badge.is-discontinued {
    color: #ca0303;
    border-color: #ca0303;
    background: #fdeeee;
}

.matrix-product-body {
    display: flex;
    align-items: stretch;
    border-top: 1px solid #eee;
}

.matrix-product-main {
    flex: 1;
    min-width: 0;
}

.matrix-product-main .matrix-table {
    border-top: none;
}

.matrix-selected-line {
    padding: 12px 20px;
    background: #f7f7f7;
    font-size: 14px;
    color: #333;
}

.matrix-product-side {
    width: 220px;
    flex: 0 0 220px;
    border-left: 1px solid #eee;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: space-between;
}

.matrix-stock-box {
    background: #f7f7f7;
    padding: 12px;
    text-align: center;
}

.matrix-stock-title {
    font-family: var(--family-Viga, sans-serif);
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.matrix-stock-values {
    font-size: 13px;
    color: #444;
    margin-bottom: 10px;
}

.matrix-backorder-msg {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.matrix-backorder-msg.is-allowed {
    color: #1a7d2c;
}

.matrix-backorder-msg.is-no-backorder {
    color: #ca0303;
}

.matrix-product-side .matrix-add-btn {
    width: 100%;
    text-align: center;
}

.matrix-product-image img {
    width: 180px;
    height: auto;
    display: block;
    border-radius: 2px;
}

.matrix-product-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.matrix-product-images li {
    width: 90px;
    height: 90px;
    border: 1px solid #eee;
    overflow: hidden;
    flex: 0 0 auto;
}

.matrix-product-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.matrix-product-name {
    font-family: var(--family-WEB, sans-serif);
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #333;
}

.matrix-product-name a {
    color: #333;
    text-decoration: none;
}

.matrix-product-meta {
    color: #767676;
    font-size: 13px;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid #eee;
}

.matrix-table th,
.matrix-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f2f2f2;
}

.matrix-table .matrix-row-label {
    text-align: left;
    font-weight: 500;
    color: #444;
    padding-left: 20px;
}

.matrix-table th {
    font-family: var(--family-Viga, sans-serif);
    font-size: 13px;
    text-transform: uppercase;
    color: #333;
    background: #fafafa;
}

.matrix-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .15);
    vertical-align: middle;
    margin-right: 6px;
    background-size: cover;
    background-position: center;
}

.matrix-table .matrix-corner {
    background: #fafafa;
}

.matrix-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 2px solid #000;
}

.matrix-step {
    width: 26px;
    background: #f5f5f5;
    border: none;
    color: #000;
    font-family: var(--family-WEB, sans-serif);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.matrix-step:hover {
    background: #e5e5e5;
}

.matrix-step:active {
    background: #ddd;
}

.matrix-qty {
    width: 42px;
    text-align: center;
    border: none;
    border-left: 2px solid #000;
    border-right: 2px solid #000;
    background: transparent;
    padding: 4px 0;
    font-family: var(--family-WEB, sans-serif);
    font-weight: bold;
    font-size: 15px;
    box-shadow: none;
    border-radius: 0;
    -moz-appearance: textfield;
}

.matrix-qty::-webkit-inner-spin-button,
.matrix-qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.matrix-qty:focus {
    outline: none;
}

.matrix-qty::placeholder {
    color: #bbb;
    font-weight: normal;
}

.matrix-qty[disabled] {
    background: #f2f2f2;
    color: #bbb;
    cursor: not-allowed;
}

.matrix-row-qty {
    font-weight: 500;
    color: #555;
}

.matrix-unavailable {
    padding: 18px 20px;
    color: #999;
}

.matrix-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f7f7f7;
    font-size: 14px;
}

.matrix-add-btn,
.matrix-cart-actions .action.update {
    font-family: var(--family-Viga, sans-serif);
    font-size: 14px;
    color: #fff;
    background-color: #ca0303;
    border: 2px solid #ca0303;
    text-transform: uppercase;
    padding: 9.5px 17px;
    position: relative;
    transition: all .2s ease-in-out;
    cursor: pointer;
}

.matrix-add-btn::before,
.matrix-cart-actions .action.update::before {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    top: -8px;
    left: -8px;
    z-index: 1;
    border: 2px solid #000000;
    transition: all .5s;
    position: absolute;
    content: "";
}

.matrix-add-btn:not([disabled]):hover::before,
.matrix-cart-actions .action.update:hover::before {
    top: -2px;
    left: -2px;
    height: 100%;
    width: 100%;
}

.matrix-add-btn[disabled] {
    background-color: var(--gray, #aaaaaa);
    border-color: var(--gray, #aaaaaa);
    cursor: not-allowed;
}

.matrix-add-btn[disabled]::before {
    display: none;
}

.matrix-add-btn.loading {
    opacity: .6;
    pointer-events: none;
}

.matrix-cell-empty {
    color: #ccc;
}

.matrix-cart-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.matrix-hint {
    color: #888;
    font-size: 13px;
    margin: 0;
}

.matrix-add-more {
    opacity: .95;
}

.cart-empty {
    padding: 40px 0;
    text-align: center;
}

.matrix-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.matrix-lightbox-overlay.active {
    display: flex;
}

.matrix-lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.matrix-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}
