/* Map custom cart variables to theme.css variables */
:root {
  --muted: var(--text-2);
  --line: var(--border);
  --panel: var(--surface);
  --pill: var(--accent-orange);
  --pillText: #FFFFFF;
  --accent: var(--accent-orange);
}

[data-theme="dark"] {
  --muted: var(--text-2);
  --line: var(--border);
  --panel: var(--surface);
  --pill: var(--accent-orange);
  --pillText: #FFFFFF;
  --accent: var(--accent-orange);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.4 system-ui, Segoe UI, Roboto;
}

.wrap {
    margin-top: 100px !important;
    max-width: 1100px;
    margin: auto;
    padding: 20px;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    .wrap {
        grid-template-columns: 2fr 1fr;
    }
}

/* Mobile cart width fix */
@media (max-width: 959px) {
    .wrap {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .wrap > section,
    .wrap > aside {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .wrap .card {
        width: 100% !important;
    }
}

.steps {
    display: flex;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--muted);
    margin: 8px 0 12px;
}

.steps b {
    color: var(--text);
}

.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.list {
    padding: 8px;
    display: block;
    width: 100%;
    min-width: 100%;
}

.row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.row:first-child {
    border-top: 0;
}

.thumb {
    width: 84px;
    height: 64px;
    border-radius: 10px;
    background: #000;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title {
    font-weight: 600;
}

.sub {
    color: var(--muted);
    font-size: 0.9rem;
}

.price {
    font-weight: 700;
    font-family: myfont;
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.qty button {
    width: 32px;
    height: 32px;
    border: 0;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.qty span {
    min-width: 32px;
    text-align: center;
}

.icon {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.aside {
    position: sticky;
    top: 16px;
}

.box-summary {
    padding: 16px;
}

.tot {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    color: var(--muted);
}

.tot strong {
    color: var(--text);
}

.total {
    border-top: 1px solid var(--line);
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    font-weight: 800;
}

.btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 999px;
    background: black;
    color: white;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.coupon {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.coupon input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
}

.coupon button {
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
}

.coupon button:hover {
    background: var(--surface-hover);
}

.empty {
    padding: 18px;
    text-align: center;
    color: var(--muted);
}

/* Cart Item Styles */
.cart-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.cart-item-facevalue {
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    padding: 8px 12px;
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.qty-btn:hover {
    background-color: var(--surface-hover);
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.cart-item-price {
    min-width: 100px;
    text-align: right;
    margin: 0;
    font-weight: bold;
    font-size: 16px;
}

.remove-btn {
    padding: 4px 6px;
    background-color: var(--surface);
    color: rgba(255, 0, 0, 1);
    border: 1px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    width: 30px;
    height: 30px;
}

.remove-btn:hover {
    background-color: var(--surface-hover);
}

/* Mobile - keep same layout as desktop but smaller */
@media (max-width: 768px) {
    .cart-item {
        gap: 8px;
        padding: 10px;
    }
    
    .cart-item-title {
        font-size: 12px;
    }
    
    .cart-item-facevalue {
        font-size: 10px;
    }
    
    .quantity-controls {
        gap: 4px;
    }
    
    .qty-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .qty-value {
        min-width: 20px;
        font-size: 12px;
    }
    
    .cart-item-price {
        min-width: 60px;
        font-size: 12px;
    }
    
    .remove-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
        padding: 2px;
    }
}