/* ============================================================
   Custom Cart Page — cart.css  v2.0  (screenshot-accurate)
   ============================================================ */
:root {
    --green:        #2e7d32;
    --green-dark:   #1b5e20;
    --green-light:  #e8f5e9;
    --red:          #c0392b;   /* price colour */
    --border:       #e0e0e0;
    --bg:           #eef2eb;   /* page bg — same pale green-grey as screenshot */
    --white:        #ffffff;
    --text:         #1a1a1a;
    --muted:        #888;
    --radius:       10px;
}

/* ============================================================  WRAPPER */
#ccp-cart-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    position: relative;
}

/* ============================================================  LAYOUT */
.ccp-layout { display: flex; gap: 28px; align-items: flex-start; }
.ccp-items-col   { flex: 1 1 0; min-width: 0; }
.ccp-summary-col { flex: 0 0 340px; width: 340px; }

/* ============================================================  HEADER BAR */
.ccp-items-header {
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--white);
    padding: 14px 16px 12px;
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    color: var(--text);
}
.ccp-item-count { font-weight: 400; color: var(--muted); margin-left: 4px; font-size: .9rem; }

/* ============================================================  ITEMS LIST */
#ccp-items-list {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

/* ============================================================
   SINGLE ITEM
   Two-column flex:
     col1 = image (fixed width)
     col2 = .ccp-item-right (fills remaining)
   ============================================================ */
.ccp-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 14px 18px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    transition: background .15s;
}
.ccp-item:last-child { border-bottom: none; }
.ccp-item:hover { background: #fafff8; }

/* --- Image --- */
.ccp-item-img { flex: 0 0 auto; }
.ccp-item-img img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    display: block;
}

/* --- Right block --- */
.ccp-item-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Name row: name text + X button side by side */
.ccp-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ccp-item-name {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    flex: 1;
    word-break: break-word;
}

/* X remove button — top right corner like screenshot */
.ccp-remove-btn {
    flex: 0 0 auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-top: 1px;
    transition: color .15s;
}
.ccp-remove-btn:hover { color: var(--red); }

/* Unit price in RED bold — below name */
.ccp-unit-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 10px;
}
/* WooCommerce wraps price in <span class="woocommerce-Price-amount"> */
.ccp-unit-price .woocommerce-Price-currencySymbol,
.ccp-row-subtotal .woocommerce-Price-currencySymbol { font-size: inherit; }

/* Qty stepper — wide box with thin − and + signs */
.ccp-qty-wrap {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid #bbb;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    width: fit-content;
    margin-bottom: 10px;
}
.ccp-qty-btn {
    width: 52px;
    height: 52px;
    background: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background .12s;
    line-height: 1;
}
.ccp-qty-btn:hover  { background: #f0f0f0; }
.ccp-qty-btn:active { background: var(--green); color: #fff; }

.ccp-qty-input {
    width: 60px;
    height: 52px;
    border: none;
    border-left: 1.5px solid #bbb;
    border-right: 1.5px solid #bbb;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    background: var(--white);
    outline: none;
    -moz-appearance: textfield;
}
.ccp-qty-input::-webkit-inner-spin-button,
.ccp-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Row subtotal in RED — below stepper */
.ccp-row-subtotal {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--red);
    margin-top: 2px;
}

/* ============================================================  CONTINUE */
.ccp-continue-row { margin-top: 14px; }

/* ============================================================  BUTTONS */
.ccp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .18s, transform .1s;
    line-height: 1;
}
.ccp-btn:active { transform: scale(.97); }
.ccp-btn-green         { background: var(--green); color: #fff; }
.ccp-btn-green:hover   { background: var(--green-dark); color: #fff; }
.ccp-btn-green:visited { color: #fff; }
.ccp-btn-outline       { background: transparent; color: var(--green); border: 2px solid var(--green); }
.ccp-btn-outline:hover { background: var(--green-light); }

/* ============================================================  SUMMARY BOX */
.ccp-summary-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: 0 2px 14px rgba(0,0,0,.07);
    position: sticky;
    top: 20px;
}
.ccp-summary-title {
    font-size: 1.05rem;
    font-weight: 700;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--green-light);
}
.ccp-srow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .93rem;
    padding: 7px 0;
}
.ccp-srow span:last-child { font-weight: 600; }
.ccp-discount-row   { color: var(--green); }
.ccp-discount-val   { font-weight: 700 !important; }
.ccp-sdivider       { height: 1px; background: var(--border); margin: 8px 0; }
.ccp-total-row      { font-size: 1.1rem; font-weight: 800; }
.ccp-total-row span:last-child { color: var(--green); font-size: 1.2rem; }

/* ============================================================  COUPON */
.ccp-coupon-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ccp-coupon-label { font-size: .84rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.ccp-coupon-row   { display: flex; gap: 8px; }
#ccp-coupon-input {
    flex: 1; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: .88rem; outline: none; background: #fafafa;
    transition: border-color .15s;
}
#ccp-coupon-input:focus { border-color: var(--green); background: #fff; }
#ccp-apply-coupon       { padding: 10px 14px; font-size: .85rem; white-space: nowrap; }

.ccp-coupon-msg { margin-top: 7px; font-size: .82rem; padding: 7px 10px; border-radius: 6px; }
.ccp-coupon-msg.success { background: var(--green-light); color: var(--green); }
.ccp-coupon-msg.error   { background: #fce4ec; color: #b71c1c; }

.ccp-applied-coupons { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ccp-ctag {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--green-light); color: var(--green);
    font-size: .8rem; font-weight: 700;
    padding: 4px 10px; border-radius: 20px; border: 1px solid var(--green);
}
.ccp-remove-coupon {
    background: none; border: none; cursor: pointer;
    color: var(--green); font-size: .75rem; padding: 0; line-height: 1;
}
.ccp-remove-coupon:hover { color: #b71c1c; }

/* Checkout btn */
.ccp-checkout-btn {
    display: flex; width: 100%;
    margin-top: 18px; font-size: 1rem;
    padding: 14px; border-radius: 9px;
}
.ccp-secure-note { text-align: center; font-size: .74rem; color: var(--muted); margin: 8px 0 0; }

/* ============================================================  EMPTY */
.ccp-empty-cart { text-align: center; padding: 60px 20px; }
.ccp-empty-icon { font-size: 4rem; display: block; margin-bottom: 14px; }
.ccp-empty-cart h2 { margin-bottom: 20px; }

/* ============================================================  LOADER */
#ccp-loader {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.ccp-spinner {
    width: 42px; height: 42px;
    border: 4px solid #ddd;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: ccp-spin .7s linear infinite;
}
@keyframes ccp-spin  { to { transform: rotate(360deg); } }
@keyframes ccp-flash { 0% { opacity:.4 } 100% { opacity:1 } }
.ccp-flash { animation: ccp-flash .4s ease; }

/* ============================================================
   TABLET  ≤ 860px — stack layout
   ============================================================ */
@media (max-width: 860px) {
    .ccp-layout      { flex-direction: column; }
    .ccp-summary-col { flex: 1 1 auto; width: 100%; }
    .ccp-summary-box { position: static; }
}

/* ============================================================
   MOBILE  ≤ 600px — flush, full-width, screenshot-identical
   ============================================================ */
@media (max-width: 600px) {

    #ccp-cart-wrapper { padding: 0 0 60px; }

    /* header flush */
    .ccp-items-header { border-radius: 0; border-left: none; border-right: none; }

    /* items list flush */
    #ccp-items-list { border-radius: 0; border-left: none; border-right: none; }

    /* item padding */
    .ccp-item { padding: 16px 12px; gap: 12px; }

    /* image size */
    .ccp-item-img img { width: 90px; height: 90px; }

    /* name size */
    .ccp-item-name { font-size: .97rem; }

    /* price size */
    .ccp-unit-price  { font-size: 1.1rem; margin-bottom: 9px; }
    .ccp-row-subtotal{ font-size: 1.1rem; }

    /* stepper — match screenshot exactly: thin − 1 + in a wide rounded box */
    .ccp-qty-wrap  { border-radius: 9px; }
    .ccp-qty-btn   { width: 56px; height: 52px; font-size: 1.6rem; font-weight: 200; }
    .ccp-qty-input { width: 56px; height: 52px; font-size: 1.05rem; }

    /* X button */
    .ccp-remove-btn { font-size: 1.15rem; margin-top: 3px; }

    /* Continue button full-width */
    .ccp-continue-row { padding: 14px 12px; }
    .ccp-btn-outline  { width: 100%; }

    /* Summary flush */
    .ccp-summary-box { border-radius: 0; border-left: none; border-right: none; margin-top: 10px; }

    /* Coupon stacked */
    .ccp-coupon-row   { flex-direction: column; }
    #ccp-apply-coupon { width: 100%; padding: 12px; }
}
