/* HapiFood Cart Dropdown */

#cdrop-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1099;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#cdrop-overlay.on {
  opacity: 1;
  visibility: visible;
}

#cart-drop {
  position: fixed;
  top: 82px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e8e2d8;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 32px 80px rgba(0,0,0,0.10);
  z-index: 1100;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#cart-drop.open {
  opacity: 1;
  transform: translateY(0);
}
.admin-bar #cart-drop {
  top: 114px;
}

/* Header */
.cd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e2d8;
  flex-shrink: 0;
  background: #fff;
}
.cd-head-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1714;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cd-head-cnt {
  background: #b8936a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cd-head-close {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  font-size: 16px;
  color: #9a9590;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cd-head-close:hover {
  background: #f8f5f0;
  color: #1a1714;
}

/* Body */
.cd-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
  min-height: 100px;
}

/* Ürün satırı */
.cd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe3;
}
.cd-item:last-child {
  border-bottom: none;
}
.cd-item-img {
  width: 60px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ebe3;
  flex-shrink: 0;
}
.cd-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cd-item-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.cd-item-info {
  flex: 1;
  min-width: 0;
}
.cd-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1714;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.cd-item-unit {
  font-size: 12px;
  color: #9a9590;
}
.cd-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.cd-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid #e8e2d8;
  border-radius: 8px;
  overflow: hidden;
}
.cd-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: #1a1714;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.cd-qty-btn:hover {
  background: #f8f5f0;
}
.cd-qty-num {
  width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #1a1714;
  border-left: 1.5px solid #e8e2d8;
  border-right: 1.5px solid #e8e2d8;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cd-item-total {
  font-size: 14px;
  font-weight: 700;
  color: #1a1714;
}
.cd-item-remove {
  font-size: 11px;
  color: #9a9590;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  text-decoration: underline;
}
.cd-item-remove:hover {
  color: #dc2626;
}

/* Empty */
.cd-empty {
  text-align: center;
  padding: 40px 20px;
}
.cd-empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}
.cd-empty p {
  font-size: 14px;
  color: #78716c;
  margin-bottom: 16px;
}
.cd-empty a {
  font-size: 13px;
  color: #b8936a;
  font-weight: 500;
  text-decoration: none;
}

/* Footer */
.cd-foot {
  padding: 16px 20px;
  background: #f8f5f0;
  border-top: 1px solid #e8e2d8;
  flex-shrink: 0;
}
.cd-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cd-total-row span {
  font-size: 14px;
  color: #78716c;
}
.cd-total-row strong {
  font-size: 20px;
  font-weight: 700;
  color: #1a1714;
}
.cd-checkout-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: #b8936a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.cd-checkout-btn:hover {
  background: #9a7550;
  color: #fff;
}
.cd-cart-link {
  display: block;
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #78716c;
  border: 1.5px solid #e8e2d8;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  box-sizing: border-box;
}
.cd-cart-link:hover {
  border-color: #1a1714;
  color: #1a1714;
}

/* Loading spinner */
.cd-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.cd-spinner .spin {
  width: 32px;
  height: 32px;
  border: 2.5px solid #e8e2d8;
  border-top-color: #b8936a;
  border-radius: 50%;
  animation: cdspin 0.7s linear infinite;
}
@keyframes cdspin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  #cart-drop {
    right: 10px;
    left: 10px;
    width: auto;
    top: 72px;
    max-height: calc(100vh - 80px);
  }
  .admin-bar #cart-drop {
    top: 118px;
  }
}
