/* Cart page (resources/views/cart.blade.php). All classes use the jcp- prefix. */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/dmsans/dmsans-latin.woff2') format('woff2');
}

.jcp {
    --jcp-red: #d3122a;
    --jcp-red-dark: #b00f23;
    --jcp-ink: #15171c;
    --jcp-muted: #5a5f6b;
    --jcp-line: #e7e9ee;
    --jcp-soft: #f3f4f7;
    --jcp-green: #0f7a45;
    background: #f4f4f5;
    color: var(--jcp-ink);
    font-family: 'DM Sans', sans-serif;
}
.jcp *, .jcp *::before, .jcp *::after { box-sizing: border-box; }
.jcp a { color: var(--jcp-ink); text-decoration: none; }
.jcp a:hover { color: #000; }
.jcp button { font-family: inherit; }

.jcp-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 16px 64px; }
.jcp-heading { margin: 0 0 18px; font-family: inherit; font-size: 22px; font-weight: 700; color: var(--jcp-ink); }

.jcp-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.jcp-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.jcp-side { flex: 1 1 340px; min-width: 0; }

.jcp-card {
    background: #fff;
    border: 1px solid var(--jcp-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(20, 24, 32, .04);
}

/* Select all bar */
.jcp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; }
.jcp-bar label { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.jcp-check { width: 18px; height: 18px; margin: 0; accent-color: var(--jcp-red); cursor: pointer; flex-shrink: 0; }

.jcp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: 999px; background: var(--jcp-red); color: #fff;
    font-weight: 600; cursor: pointer; transition: transform .2s ease, background-color .2s ease;
}
.jcp-btn:hover { background: var(--jcp-red-dark); color: #fff; transform: translateY(-2px); }
.jcp-btn:disabled { opacity: .45; cursor: default; transform: none; background: var(--jcp-red); }
.jcp-btn-sm { height: 40px; padding: 0 20px; font-size: 14px; }

/* Items */
.jcp-items { padding: 6px 20px; }
.jcp-item {
    display: grid; grid-template-columns: auto 96px minmax(0, 1fr); gap: 16px;
    align-items: start; padding: 18px 0; border-top: 1px solid #eceef2;
    transition: opacity .25s ease;
}
.jcp-item:first-child { border-top: 0; }
.jcp-item.is-busy { opacity: .5; pointer-events: none; }
.jcp-item > .jcp-check { align-self: center; }
.jcp-thumb {
    width: 96px; height: 96px; border-radius: 14px; background: var(--jcp-soft);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.jcp-thumb img { max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain; }
.jcp-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.jcp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.jcp-name { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.jcp-meta { font-size: 13px; color: var(--jcp-muted); }
.jcp-meta span { color: var(--jcp-ink); }
.jcp-trash {
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; flex-shrink: 0;
    background: transparent; color: var(--jcp-red); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background-color .2s ease;
}
.jcp-trash:hover { background: #fde8ea; }
.jcp-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.jcp-line-total { font-size: 17px; font-weight: 800; }
.jcp-each { font-size: 12px; color: var(--jcp-muted); margin-top: 2px; }
.jcp-each[hidden] { display: none; }

.jcp-qty {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    border: 1px solid #e3e6eb; border-radius: 999px; background: #fafafb;
}
.jcp-qty button {
    width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--jcp-ink); font-size: 18px; font-weight: 500; line-height: 1;
    cursor: pointer; transition: background-color .2s ease;
}
.jcp-qty button:hover { background: #ececee; }
.jcp-qty button:disabled { color: #b5b9c2; cursor: default; background: transparent; }
.jcp-qty .item-quantity {
    width: 30px; height: 34px; padding: 0; border: 0; background: transparent;
    text-align: center; font-size: 14px; font-weight: 600; color: var(--jcp-ink); pointer-events: none;
}

/* Empty state */
.jcp-empty { padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.jcp-empty[hidden], .jcp-has-items[hidden] { display: none; }
.jcp-empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--jcp-soft); display: flex; align-items: center; justify-content: center; }
.jcp-empty-text { font-size: 17px; font-weight: 700; }

.jcp-continue { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; }

/* Summary */
.jcp-summary { border-radius: 20px; padding: 22px; box-shadow: 0 10px 30px rgba(20, 24, 32, .07); }
.jcp-summary-title { margin: 0 0 16px; font-family: inherit; font-size: 17px; font-weight: 700; color: var(--jcp-ink); }
.jcp-coupon { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px; border-radius: 14px; background: var(--jcp-soft); }
.jcp-coupon input {
    flex: 1; min-width: 0; height: 40px; border: 0; background: transparent;
    font-size: 14px; font-weight: 500; color: var(--jcp-ink); outline: none;
}
.jcp-coupon input:disabled { color: var(--jcp-muted); }
.jcp-coupon-btns { display: flex; }
.jcp-coupon-btns button {
    height: 40px; padding: 0 20px; border: 0; border-radius: 10px;
    background: var(--jcp-red); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.jcp-coupon-btns button:disabled { opacity: .45; cursor: default; }
.jcp-coupon-btns button.btn-success, .jcp-coupon-btns button.btn-success:disabled { background: var(--jcp-green); opacity: 1; }
#coupon-message { margin: 8px 2px 0; font-size: 13px; }
#coupon-message:empty { display: none; }

.jcp-rows { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; font-size: 15px; }
.jcp-row { display: flex; justify-content: space-between; gap: 12px; }
.jcp-row[hidden] { display: none; }
.jcp-row > span:first-child { color: var(--jcp-muted); }
.jcp-row > span:last-child { font-weight: 700; }
.jcp-row.is-discount > span { color: var(--jcp-green); }
.jcp-divider { height: 1px; background: var(--jcp-line); margin: 18px 0; }
.jcp-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.jcp-total > span:first-child { font-size: 16px; font-weight: 700; }
.jcp-total > span:last-child { font-size: 22px; font-weight: 800; }
.jcp-checkout { margin-top: 20px; width: 100%; height: 56px; border-radius: 14px; font-size: 15px; font-weight: 700; }
.jcp a.jcp-checkout, .jcp a.jcp-checkout:hover { color: #fff; }
.jcp a.jcp-checkout.is-disabled { opacity: .45; pointer-events: none; cursor: default; transform: none; }

/* Small notice (replaces the old browser alert popups) */
.jcp-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 9999;
    max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
    background: var(--jcp-ink); color: #fff; font: 600 14px 'DM Sans', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.jcp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 767px) {
    .jcp-wrap { padding: 24px 14px 48px; }
    .jcp-items { padding: 4px 14px; }
    .jcp-bar { padding: 10px 10px 10px 14px; }
    .jcp-item { grid-template-columns: auto 76px minmax(0, 1fr); gap: 12px; }
    .jcp-thumb { width: 76px; height: 76px; }
    .jcp-name { font-size: 15px; }
    .jcp-summary { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .jcp-btn, .jcp-item, .jcp-toast { transition: none; }
    .jcp-btn:hover { transform: none; }
}
