/* ===== UNIFIED CART PANEL STYLING ===== */
/* Floating Cart Tab Button */
.cart-tab {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1e4d32;
  color: #fff;
  padding: 12px 16px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  transition: all .3s ease;
  z-index: 9998;
  box-shadow: 0 4px 12px rgba(30,77,50,.3);
}
.cart-tab:hover { background:#153d28; transform:translateY(-2px); box-shadow:0 6px 16px rgba(30,77,50,.4); }
.cart-icon { font-size:18px; }
.cart-count { background:#9d7c2a; color:#fff; border-radius:50%; min-width:24px; height:24px; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; }

/* Base cart panel */
.cart-dropdown {
  position: fixed;
  background: #fff;
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.22,.9,.24,1), opacity .45s ease;
  will-change: transform, opacity;
}

/* Desktop: unified slide from right for all pages */
@media (min-width:769px){
  .cart-dropdown { top:0; right:0; left:auto; bottom:auto; width:100%; max-width:440px; max-height:90vh; transform:translateX(100%); box-shadow:-4px 0 24px rgba(0,0,0,.15); }
  .cart-dropdown.open { transform:translateX(0); opacity:1; pointer-events:auto; }
  .cart-content { max-height:calc(90vh - 240px); }
}

/* Mobile bottom sheet */
@media (max-width:768px){
  /* Mobile: hide cart tab completely - users access cart via order form */
  .cart-tab { 
    display:none !important;
  }
  .cart-dropdown { 
    left:0; 
    right:0; 
    bottom:0; 
    top:auto; 
    width:100%; 
    max-width:none;
    height:70vh; 
    border-radius:18px 18px 0 0; 
    transform:translateY(100%); 
    box-shadow:0 -4px 24px rgba(0,0,0,.25); 
    position:fixed;
  }
  .cart-dropdown.open { 
    transform:translateY(0); 
    opacity:1; 
    pointer-events:auto; 
  }
  .cart-dropdown::before { 
    content:''; 
    position:absolute; 
    top:8px; 
    left:50%; 
    transform:translateX(-50%); 
    width:54px; 
    height:5px; 
    background:rgba(0,0,0,.22); 
    border-radius:3px; 
  }
  .cart-count { 
    position:absolute; 
    top:4px; 
    right:6px; 
    min-width:20px; 
    height:20px; 
    font-size:11px; 
    box-shadow:0 2px 6px rgba(0,0,0,.25); 
  }
  body.cart-open .cart-tab { 
    display:none !important; 
  }
  body.cart-open { 
    overflow:hidden; 
    height:100%; 
    touch-action:none; 
  }
}

/* (Scroll lock rules merged into mobile section; Our Oils override merged above) */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.cart-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.cart-header {
  background: linear-gradient(135deg, #1e4d32, #153d28);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cart-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.cart-content {
  padding: 20px 24px;
  flex: 0 1 auto;
  overflow-y: auto;
  background: #fafafa;
  position: relative;
  scroll-behavior: smooth;
}

/* Polished scrolling: subtle custom scrollbar (WebKit) */
.cart-content::-webkit-scrollbar { width: 10px; }
.cart-content::-webkit-scrollbar-track { background: #f0f2f1; border-radius: 20px; }
.cart-content::-webkit-scrollbar-thumb { background: #c8d3cd; border-radius: 20px; border: 2px solid #f0f2f1; }
.cart-content::-webkit-scrollbar-thumb:hover { background: #9d7c2a; }

/* Gradient fades at top & bottom to hint overflow */
.cart-content::before,
.cart-content::after {
  content: '';
  position: sticky;
  left: 0;
  right: 0;
  height: 26px;
  pointer-events: none;
  z-index: 3;
}
.cart-content::before { top: 0; background: linear-gradient(to bottom, rgba(250,250,250,0.95), rgba(250,250,250,0)); }
.cart-content::after { bottom: 0; background: linear-gradient(to top, rgba(250,250,250,0.95), rgba(250,250,250,0)); }

.empty-cart {
  text-align: center;
  color: #999;
  font-size: 15px;
  margin: 40px 0;
  padding: 20px;
}

.empty-cart::before {
  content: '🛒';
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  gap: 12px;
  transition: all 0.3s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cart-item:last-child {
  margin-bottom: 0;
}

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

.cart-item-name {
  font-weight: 700;
  color: #1e4d32;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.cart-item-details {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-price {
  font-weight: 700;
  color: #153d28;
  font-size: 16px;
  margin-top: 8px;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-item-remove {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.cart-item-remove:hover {
  background: #fcc;
  border-color: #c33;
  color: #911;
}

.cart-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid #e0e0e0;
}

.cart-stepper button {
  width: 28px;
  height: 28px;
  border: 1px solid #1e4d32;
  background: white;
  color: #1e4d32;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-stepper button:hover {
  background: #1e4d32;
  color: white;
}

.cart-stepper input {
  width: 30px;
  height: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  color: #1e4d32;
}

.cart-stepper input:focus {
  outline: none;
  border-color: #9d7c2a;
}

.cart-footer {
  background: white;
  padding: 20px 24px;
  border-top: 2px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  margin-top: auto;
}

.cart-total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 12px;
  border: 2px solid #1e4d32;
}

.cart-total-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.cart-total-amount {
  font-size: 24px;
  font-weight: 800;
  color: #1e4d32;
}

.cart-actions {
  display: flex;
  gap: 12px;
}

.cart-clear-btn {
  flex: 1;
  padding: 14px 20px;
  background: white;
  border: 2px solid #dc3545;
  color: #dc3545;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cart-clear-btn:hover {
  background: #dc3545;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cart-proceed-btn {
  flex: 2;
  padding: 14px 24px;
  background: linear-gradient(135deg, #1e4d32, #153d28);
  border: none;
  color: white;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(30, 77, 50, 0.3);
}

.cart-proceed-btn:hover {
  background: linear-gradient(135deg, #153d28, #1e4d32);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 77, 50, 0.4);
}

.cart-proceed-btn:active {
  transform: translateY(0);
}

@media (max-width:768px){
  .cart-content {
    max-height: calc(70vh - 280px);
    /* Maintain gradient fades on mobile (adjust height shorter) */
  }
  .cart-footer {
    padding: 16px 20px;
  }
  .cart-actions {
    flex-direction: column;
  }
  .cart-clear-btn,
  .cart-proceed-btn {
    flex: 1;
  }
  .cart-item {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .cart-item-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
