/* ============================================================
   VIVA Cart Page – v1.0.0
   ============================================================ */

/* ── Banner ─────────────────────────────────────────────── */
.viva-cart-banner {
    background-color: #f3ecf5;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.viva-cart-banner__inner {
    max-width: 1440px;
    width: 92%;
    margin: 0 auto;
}

.viva-cart-banner__title {
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 700;
    color: #1d1d1d;
    margin: 0 0 6px;
}

.viva-cart-banner__count {
    font-size: 16px;
    color: #555;
    margin: 0;
}

/* ── Page wrapper ─────────────────────────────────────── */
.viva-cart-page {
    max-width: 1440px;
    width: 92%;
    margin: 40px auto 60px;
    box-sizing: border-box;
}

/* ── Empty state ───────────────────────────────────────── */
.viva-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
    color: #888;
}

.viva-cart-empty p {
    font-size: 16px;
    margin: 0;
}

.viva-cart-back-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #1d1d1d;
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.3s ease;
}

.viva-cart-back-btn:hover {
    background: #444;
    color: #fff;
}

/* ── Cart form ─────────────────────────────────────────── */
.viva-cart-form {
    margin: 0;
}

/* ── Items list ────────────────────────────────────────── */
.viva-cart-items {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
}

/* Header row */
.viva-cart-header-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 12px 24px;
    background: #f8f8f8;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    border-bottom: 1px solid #eee;
}

/* Each cart row */
.viva-cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto 36px;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

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

/* Image */
.viva-cart-item__img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.viva-cart-item__img img {
    width: 100px !important;
    height: 100px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    float: none !important;
}

.viva-cart-item__img a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Info */
.viva-cart-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.viva-cart-item__name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1d;
    text-decoration: none;
    line-height: 1.4;
}

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

.viva-cart-item__meta {
    font-size: 12px;
    color: #888;
}

.viva-cart-item__meta dl,
.viva-cart-item__meta dt,
.viva-cart-item__meta dd {
    display: inline;
    margin: 0;
    padding: 0;
}

.viva-cart-item__meta dt::after { content: ': '; }
.viva-cart-item__meta dd::after { content: ' · '; }
.viva-cart-item__meta dd:last-child::after { content: ''; }
.viva-cart-item__price { font-size: 13px; color: #555; margin-top: 4px; }
.viva-cart-item__price .viva-price-poa { color: #aaa; font-style: italic; }

/* Qty stepper */
.viva-cart-item__qty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.viva-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
}

.viva-qty-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.viva-qty-btn:hover {
    background: #f0f0f0;
    color: #1d1d1d;
}

.viva-cart-qty-input,
.viva-atq-qty {
    width: 42px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1d;
    padding: 0;
    height: 34px;
    line-height: 34px;
    background: transparent;
    -moz-appearance: textfield;
}

.viva-cart-qty-input:focus,
.viva-atq-qty:focus {
    outline: none;
}

.viva-cart-qty-input::-webkit-inner-spin-button,
.viva-cart-qty-input::-webkit-outer-spin-button,
.viva-atq-qty::-webkit-inner-spin-button,
.viva-atq-qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove */
.viva-cart-item__remove {
    display: flex;
    align-items: center;
    justify-content: center;
}

.viva-cart-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #bbb;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.viva-cart-remove:hover {
    color: #c0392b;
    background: #fdf0f0;
}

/* ── Category count summary ───────────────────────────── */
.viva-cart-category-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px;
    background: #fafafa;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.viva-cart-cat-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

.viva-cart-cat-tag__count {
    font-weight: 700;
    color: #1d1d1d;
    margin-left: 4px;
}

/* ── Cart footer ───────────────────────────────────────── */
.viva-cart-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: start;
    padding: 32px 0 0;
}

.viva-cart-note-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.viva-cart-note-label span {
    font-weight: 400;
    color: #888;
}

.viva-cart-note-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1d1d1d;
    background: #f8f8f8;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
    line-height: 1.5;
}

.viva-cart-note-textarea:focus {
    outline: none;
    border-color: #aaa;
    background: #fff;
}

.viva-cart-footer__cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    min-width: 200px;
}

.viva-cart-checkout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #1d1d1d;
    color: #fff;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.viva-cart-checkout-btn:hover {
    background: #444;
    color: #fff;
}

.viva-cart-continue-btn {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    text-align: center;
    transition: color 0.2s ease;
}

.viva-cart-continue-btn:hover {
    color: #1d1d1d;
    text-decoration: underline;
}

/* ── Cross-sells ───────────────────────────────────────── */
.viva-cart-cross-sells {
    margin-top: 56px;
}

.viva-cart-cross-sells__title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1d;
    margin: 0 0 24px;
}

.viva-cart-cross-sells__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.viva-cart-cs-card {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease;
}

.viva-cart-cs-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.viva-cart-cs-card__img {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.viva-cart-cs-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.viva-cart-cs-card:hover .viva-cart-cs-card__img img {
    transform: scale(1.03);
}

.viva-cart-cs-card__body {
    padding: 14px 16px 10px;
    flex: 1;
}

.viva-cart-cs-card__name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1d;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}

.viva-cart-cs-card__name:hover {
    text-decoration: underline;
}

.viva-cart-cs-card__desc {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.viva-cart-cs-card__action {
    padding: 10px 16px 16px;
}

/* ATQ row in cross-sells */
.viva-atq-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viva-atq-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #1d1d1d;
    color: #fff !important;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.25s ease;
    white-space: nowrap;
    border: none;
    flex: 1;
    justify-content: center;
}

.viva-atq-btn:hover {
    background: #444;
    color: #fff !important;
}

.viva-atq-icon {
    flex-shrink: 0;
}

/* ── Price on Quote / Price display ───────────────────── */
.viva-price-tag {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1d;
}

.viva-price-poa {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
    .viva-cart-cross-sells__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .viva-cart-footer {
        grid-template-columns: 1fr;
    }

    .viva-cart-footer__cta {
        width: 100%;
    }

    .viva-cart-checkout-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .viva-cart-page {
        width: 96%;
        margin: 24px auto 40px;
    }

    .viva-cart-item {
        grid-template-columns: 80px 1fr 36px;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 16px;
    }

    .viva-cart-item__qty {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
    }

    .viva-cart-item__remove {
        grid-column: 3;
        grid-row: 1;
    }

    .viva-cart-item__img {
        grid-row: 1 / 3;
        width: 80px;
        height: 80px;
    }

    .viva-cart-item__img img {
        width: 80px !important;
        height: 80px !important;
    }

    .viva-cart-header-row {
        display: none;
    }

    .viva-cart-cross-sells__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
