/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #2d2d2d;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e6ea;
}

.header img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

/* ===== PROGRESS BAR ===== */
.progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.progress span {
    color: #9aa5b4;
    font-weight: 500;
}

.progress span.active {
    color: #414833;
    font-weight: 700;
    border-bottom: 2px solid #414833;
    padding-bottom: 2px;
}

.progress .separator {
    color: #ccc;
    font-size: 11px;
}

/* ===== CART WRAPPER ===== */
.cart {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ===== CART HEADER (column labels) ===== */
.cart-header {
    display: grid;
    grid-template-columns: 1fr 150px 100px 100px 44px;
    gap: 8px;
    align-items: center;
    padding: 0 8px 14px;
    border-bottom: 2px solid #f0f2f5;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9aa5b4;
}

.cart-header > div:nth-child(2),
.cart-header > div:nth-child(3),
.cart-header > div:nth-child(4) {
    text-align: center;
}

/* 5th cell — empty placeholder for delete column */
.cart-header > div:nth-child(5) {
    display: block;
}

/* ===== CART ITEM ===== */
.cart-item {
    display: grid;
    grid-template-columns: 1fr 150px 100px 100px 44px;
    gap: 8px;
    align-items: center;   /* vertically centres ALL cells incl. delete */
    padding: 14px 8px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.2s ease;
    border-radius: 10px;
    position: relative;
}

.cart-item:last-of-type {
    border-bottom: none;
}

.cart-item:hover {
    background: #f9fafb;
}

/*
 * On desktop .cart-item-right is a transparent pass-through:
 * its 4 children (info-dup, quantity, prices-wrap, delete)
 * slot directly into the parent 5-column grid via display:contents.
 */
.cart-item-right {
    display: contents;
}

/* Desktop: hide duplicate info inside right panel */
.cart-item-right > .cart-item-info {
    display: none;
}

/* Desktop: .cart-item-prices is also transparent — price & total-price go into grid */
.cart-item-prices {
    display: contents;
}

/* Desktop: show info only inside .cart-item-product */
.cart-item-info--desktop {
    display: block;
}

/* Product cell = image + info */
.cart-item-product {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.cart-item-product img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    background: #f5f5f5;
    flex-shrink: 0;
    padding: 6px;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-info p {
    font-size: 13px;
    color: #7a8594;
    font-weight: 500;
}

/* ===== INPUT SPINNER ===== */
.quantity {
    display: flex;
    justify-content: center;
}

.input-spinner {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e2e6ea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 38px;
}

.input-spinner button {
    background: #414833;
    border: none;
    width: 34px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.input-spinner button:hover {
    background: #535F3A;
}

.input-spinner button svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
}

.input-spinner span {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #2d2d2d;
    padding: 0 4px;
}

/* ===== PRICE CELLS ===== */
.price {
    font-size: 14px;
    color: #7a8594;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}

.total-price {
    font-size: 15px;
    font-weight: 700;
    color: #414833;
    text-align: center;
    white-space: nowrap;
}

/* ===== DELETE BUTTON — grid cell, centred ===== */
.cart-item-delete {
    display: flex;
    justify-content: center;
    align-items: center;
    /* NOT absolute on desktop — it's a real grid column */
    position: static;
}

.cart-item-delete form {
    display: flex;
}

.cart-item-delete input[type="image"] {
    width: 18px;
    height: 18px;
    opacity: 0.35;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    object-fit: contain;
}

.cart-item-delete input[type="image"]:hover {
    opacity: 0.85;
    transform: scale(1.15);
}

/* ===== CART TOTAL ===== */
.total-section {
    display: flex;
    justify-content: flex-end;
    padding: 20px 12px 8px;
    border-top: 2px solid #f0f2f5;
    margin-top: 8px;
}

.total {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

.total span {
    color: #414833;
}

/* ===== CART FOOTER ===== */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 12px 0;
    flex-wrap: wrap;
}

.cart-footer button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.cart-footer button:active {
    transform: scale(0.98);
}

.back-button {
    background: #e9ecef;
    color: #555;
}

.back-button:hover {
    background: #dee2e6;
}

.continue-button {
    background: #414833;
    color: #fff;
}

.continue-button:hover {
    background: #535F3A;
}

/* ===== HIDE native number spinners ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
