/* Overlays */
.modal-overlay,
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active,
.cart-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modals & Panels */
.dark-panel {
  background: rgba(15, 15, 17, 0.95);
  border: 1px solid var(--clr-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

/* Product Modal */
.modal-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1050;
}

.modal-panel {
  width: 90%;
  max-width: 500px;
  border-radius: 24px;
  overflow: hidden;
  transform: translateY(40px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--clr-border);
  background: rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--clr-gold);
}

.close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: var(--clr-gold);
  color: #000;
  border-color: var(--clr-gold);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

/* Custom Scrollbar for Modal/Cart */
.modal-body::-webkit-scrollbar,
.cart-items::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 3px;
}

.modal-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.modal-desc {
  color: var(--clr-text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.modal-section {
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--clr-border);
}

.modal-section h3 {
  font-size: 1rem;
  margin-bottom: 1.2rem;
  color: var(--clr-text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  width: fit-content;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--clr-border);
}

.qty-selector button {
  background: none;
  border: none;
  color: var(--clr-gold);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.qty-selector button:active {
  transform: scale(0.9);
}

.qty-selector span {
  font-weight: 600;
  font-size: 1.2rem;
  width: 30px;
  text-align: center;
  color: var(--clr-text-main);
}

.extras-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.extra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.extra-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.extra-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--clr-text-main);
  user-select: none;
}

.extra-price {
  color: var(--clr-gold);
  font-weight: 500;
  background: rgba(226, 192, 115, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Custom Checkbox */
.custom-checkbox {
  appearance: none;
  background-color: transparent;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 20px;
  height: 20px;
  border: 2px solid var(--clr-border);
  border-radius: 4px;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.custom-checkbox::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--clr-gold);
  background-color: var(--clr-gold);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
  border-color: var(--clr-gold);
}

.custom-checkbox:checked::before {
  transform: scale(1);
}

/* Custom Textarea */
.custom-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-main);
  padding: 1rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  transition: all var(--transition-fast);
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--clr-gold);
  background: rgba(0, 0, 0, 0.6);
}

.custom-textarea::placeholder {
  color: var(--clr-text-muted);
}

.modal-footer {
  padding: 2rem;
  border-top: 1px solid var(--clr-border);
  background: rgba(0, 0, 0, 0.3);
}

.price-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--clr-text-muted);
}

.price-summary span:last-child {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-gold);
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  z-index: 2000;
  transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--clr-border);
}

.cart-sidebar.active {
  right: 0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.cart-item {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 1.2rem;
  transition: transform var(--transition-fast);
}

.cart-item:hover {
  transform: translateX(-4px);
  border-color: rgba(226, 192, 115, 0.3);
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.cart-item-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--clr-text-main);
  line-height: 1.4;
  padding-right: 10px;
}

.cart-item-price {
  color: var(--clr-gold);
  font-weight: 600;
  white-space: nowrap;
}

.cart-item-extras {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.remove-btn {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: #ff453a;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.remove-btn:hover {
  background: rgba(255, 69, 58, 0.2);
  border-color: #ff453a;
}

.cart-footer {
  padding: 2rem;
  border-top: 1px solid var(--clr-border);
  background: rgba(0, 0, 0, 0.4);
}
