/* =======================
   CART.CSS  (page + drawer)
   ======================= */

/* ---------- Optional: stand-alone cart page ---------- */
.cart-page{
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
  }
  .cart-page h1{
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    color: #333;
  }
  .cart-item{
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  }
  .cart-item img{
    width: 120px; height: 120px; object-fit: cover; border-radius: 10px;
  }
  .cart-item-details{ flex: 1; }
  .cart-item-details p{ margin: 5px 0; }
  .cart-item-details label{ display:flex; align-items:center; gap:10px; margin-top:5px; }
  .cart-item-details input{ width:60px; padding:5px; border-radius:5px; border:1px solid #ccc; }
  .remove-btn{
    margin-top:10px; background:#ff4d4d; color:#fff; border:0; padding:5px 10px; border-radius:5px;
    cursor:pointer; font-weight:700; transition: background .3s;
  }
  .remove-btn:hover{ background:#cc0000; 

}
  .cart-summary{ text-align:right; margin-top:20px; font-size:1.2em; }
  .checkout-btn{
    background:#C9C78B; color:#fff; padding:10px 20px; border:0; border-radius:8px;
    cursor:pointer; font-weight:700; margin-top:10px; transition: background .3s;
  }
  .checkout-btn:hover{ background:#A9A74F; }
  .checkout-btn:disabled{ opacity:.5; cursor:not-allowed; }
  @media (max-width:768px){
    .cart-item{ flex-direction:column; align-items:flex-start; }
    .cart-item img{ width:100%; height:auto; }
    .cart-summary{ text-align:left; }
  }
  
  /* ---------- Off-canvas Cart Drawer ---------- */
  
  :root{
    --drawer-w: clamp(420px, 50vw, 620px);  /* drawer width; increase/decrease as you like */
    --thumb: 180px;                         /* product image size in drawer */
  }
  
  /* Overlay */
  .cd-overlay{
    position:fixed; inset:0;
    background:rgba(0,0,0,.45);
    backdrop-filter:blur(2px);
    opacity:0; pointer-events:none; transition:opacity .25s ease;
    z-index:9998;
  }
  .cd-overlay.active{ opacity:1; pointer-events:auto; }
  
  /* Drawer panel */
  .cd-drawer{
    position:fixed; top:0; right:0; height:100vh; width:var(--drawer-w);
    background:#fff; box-shadow:-8px 0 24px rgba(0,0,0,.15);
    transform:translateX(100%); transition:transform .3s ease;
    display:flex; flex-direction:column; z-index:9999;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,"Montserrat",sans-serif;
    box-sizing:border-box;
    overflow-x:hidden; overflow-y:hidden;
    padding-inline:28px;                   /* safe side padding */
  }
  .cd-drawer.active{ transform:translateX(0); }
  
  /* Lock page scroll when drawer is open (JS toggles this class on <body>) */
  body.lock-scroll{ overflow:hidden; }
  
  /* Header */
  .cd-header{
    display:flex; justify-content:space-between; align-items:center;
    padding:26px 4px 16px; border-bottom:1px solid #eaeaea;
  }
  .cd-header h2{
    margin:0; font-size:28px; font-weight:700; color:#2b1f1a; letter-spacing:.02em;
  }
  .cd-close{
    background:none; border:0; font-size:32px; line-height:1; cursor:pointer; color:#4a3d36;
  }
  
  /* Body */
  .cd-body{ display:flex; flex-direction:column; height:calc(100vh - 72px); }
  .cd-items{
    flex:1; overflow-y:auto; overflow-x:hidden;
    padding:18px 12px 0 4px;
    display:grid; gap:26px;
  }
  
  /* Item row */
  .cd-item{
    display:grid;
    grid-template-columns: var(--thumb) 1fr max-content; /* price column autosizes */
    column-gap:24px; align-items:start;
    padding-bottom:26px; border-bottom:1px solid #eee;
  }
  .cd-thumb{
    width:var(--thumb); aspect-ratio:1/1; object-fit:cover;
    border-radius:6px; border:1px solid #eee;
  }
  .cd-info{
    padding-top:6px; min-width:0;
  }
  .cd-info h3{
    margin:0 0 12px; font-size:22px; line-height:1.25; font-weight:700; color:#2b1f1a;
    word-break:normal; overflow-wrap:break-word;
  }
  
  /* Quantity control */
  .cd-qty{
    display:inline-grid; grid-template-columns:40px 56px 40px; height:40px;
    border:1px solid #ddd; border-radius:6px; overflow:hidden; background:#fff;
  }
  .cd-qty button{
    display:flex; align-items:center; justify-content:center; background:#fff;
    border:0; width:40px; font-size:20px; cursor:pointer; color:#2b1f1a;
  }
  .cd-qty input{
    width:56px; border:0; text-align:center; font-size:16px; outline:none;
    -webkit-appearance:none; appearance:textfield;
  }
  .cd-qty input::-webkit-outer-spin-button,
  .cd-qty input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
  
  /* Price column (right) */
  .cd-price{
    font-size:18px; font-weight:700; color:#3a2e28;
    align-self:start; justify-self:end; white-space:nowrap;
    padding-left:12px; padding-right:8px;
    overflow:visible; text-align:right;
  }
  
  /* (Optional) remove link */
  .cd-remove{
    margin-top:10px; color:#8a524e; background:none; border:0; padding:0; cursor:pointer; font-size:13px;
  }
  
  /* Summary/footer (compact) */
  .cd-summary{
    border-top:1px solid #eaeaea; background:#fafafa;
    padding:14px 12px 16px;             /* smaller than before */
  }
  .cd-row{
    display:flex; justify-content:space-between; align-items:center;
    margin-bottom:8px;
  }
  .cd-row span{ color:#3d342f; font-size:14px; }
  .cd-row strong{ font-size:18px; letter-spacing:.04em; color:#2b1f1a; }
  
  /* helper: subtle caption below subtotal */
  .cd-note{
    color:#6a5b54; font-size:13px; line-height:1.45; margin:8px 0 10px;
  }
  
  /* terms checkbox line kept tight */
  .cd-terms{
    display:flex; align-items:center; gap:10px; color:#3d342f; font-size:14px; margin-bottom:10px;
  }
  .cd-terms a{ color:#3d342f; text-decoration:underline; text-underline-offset:2px; }
  
  /* Checkout button */
  .cd-checkout{
    width:100%; height:52px; border:0; border-radius:10px;
    background:#6d6a33; color:#fff; font-weight:700; letter-spacing:.18em; font-size:15px; cursor:pointer;
    transition: transform .08s ease, opacity .2s ease;
  }
  .cd-checkout:disabled{ opacity:.5; cursor:not-allowed; }
  .cd-checkout:active{ transform: translateY(1px); }
  
  /* ---------- Responsive ---------- */
  @media (max-width: 560px){
    :root{ --thumb: 140px; }
  }
  @media (max-width: 520px){
    :root{ --thumb: 120px; }
    .cd-item{
      /* move price below info so nothing is clipped on narrow phones */
      grid-template-columns: var(--thumb) 1fr;
      grid-template-areas:
        "thumb info"
        "thumb price";
      row-gap: 6px;
    }
    .cd-thumb{ grid-area: thumb; }
    .cd-info{ grid-area: info; }
    .cd-price{ grid-area: price; justify-self:start; padding-left:0; margin-top:4px; }
    .cd-info h3{ font-size:20px; }
    .cd-qty{ grid-template-columns:40px 56px 40px; height:40px; }
  }
  /* Compact terms & checkbox alignment */
.cd-terms {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;          /* keep in one line */
    white-space: nowrap;        /* prevent breaking */
    color: #3d342f;
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  /* smaller checkbox */
  .cd-terms input {
    width: 16px;                /* smaller size */
    height: 16px;
    flex-shrink: 0;             /* don’t shrink on small screens */
    accent-color: #6d6a33;      /* gives it your site color */
  }
  
  /* link styling */
  .cd-terms a {
    color: #3d342f;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .cd-remove {
    margin-top: 8px;
    background: none;
    border: none;
    color: #a33;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
  }
  
  .cd-remove:hover {
    color: #ff1a1a;
    text-decoration: underline;
  }
  

  /* --- Remove button clean hover --- */
.cd-remove {
    margin-top: 8px;
    background: none !important;     /* fully remove any default background */
    border: none !important;
    color: #a33;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    box-shadow: none;                /* prevent button inset shadow */
  }
  
  .cd-remove:hover,
  .cd-remove:focus {
    background: none !important;     /* ensure no hover background appears */
    color: #ff1a1a;                  /* bright red hover */
    text-decoration: underline;
    outline: none;                   /* remove focus outline border */
  }

  /* ===== Drawer: small, muted size line under title ===== */
.cd-item-title { margin: 0 0 4px; font-weight: 800; color: #2b1f1a; line-height: 1.25; }
.cart-item-size { font-size: 0.9rem; color: #6b6b6b; margin: 2px 0 8px; }

/* ===== Page: title + size (matches your look) ===== */
.cp-title { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; color: #2b1f1a; line-height: 1.25; }
.cp-size  { font-size: 0.95rem; color: #6b6b6b; margin: 2px 0 6px; }
.cp-price { margin: 4px 0 10px; font-weight: 700; color: #2b1f1a; }
.cp-qty   { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cp-qty input { width: 64px; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; }
