:root {
  --red: #d42027;
  --red-hover: #b91c22;
  --orange: #f3b900;
  --cream: #fff3dd;
  --soft-orange: #ffe0a3;
  --dark: #1d1e20;
  --gray: #68707c;
  --white: #ffffff;
  --line: #ececec;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.14);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-decoration: none;
}

body {
  font-family: Poppins, sans-serif;
  background: #f6f6f6;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* ====== LAYOUT ====== */
.order-phone {
  min-height: 100vh;
  padding: 100px 7% 60px;
  background:
    radial-gradient(
      circle at top right,
      rgba(243, 185, 0, 0.2),
      transparent 40%
    ),
    linear-gradient(135deg, #fff5df 0%, #ffe3aa 55%, #ffc969 100%);
}

/* ====== TOPBAR ====== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  padding: 0 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 243, 221, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  z-index: 99;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
}

.topbar-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.topbar-menu a {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  color: #222;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.topbar-menu a:hover,
.topbar-menu a.active {
  background: var(--red);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 32, 39, 0.3);
}

/* ====== ORDER HERO ====== */
.order-hero {
  max-width: 900px;
  margin: 0 auto 28px;
  text-align: center;
}

.order-hero span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(243, 185, 0, 0.3);
}

.order-hero h1 {
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--dark);
}

.order-hero p {
  max-width: 560px;
  margin: 12px auto 0;
  color: #555;
  font-size: 14px;
  line-height: 1.7;
}

/* ====== ORDER CARD ====== */
.order-card {
  max-width: 1100px;
  margin: auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 48px rgba(95, 62, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.order-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.order-card-title span {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.order-card-title h2 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
}

.back-menu {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: #fff2d8;
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  transition: var(--transition);
  border: 1px solid rgba(243, 185, 0, 0.2);
}

.back-menu:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(243, 185, 0, 0.3);
}

/* ====== CART AREA ====== */
.cart-area h3,
#orderForm h3 {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
}

.cart-list {
  display: grid;
  gap: 10px;
}

.empty {
  padding: 20px;
  border-radius: var(--radius-md);
  background: #fdf8ef;
  color: #777;
  font-size: 13px;
  text-align: center;
  border: 1px dashed rgba(243, 185, 0, 0.3);
}

.cart-row {
  display: grid;
  grid-template-columns: 76px 1fr 120px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff8ea;
  border: 1px solid rgba(243, 185, 0, 0.1);
  transition: var(--transition);
}

.cart-row:hover {
  box-shadow: var(--shadow-sm);
}

.cart-row img {
  width: 72px;
  height: 64px;
  object-fit: contain;
}

.cart-row h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
}

.cart-row small {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.qty button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: grid;
  place-items: center;
}

.qty button:hover {
  background: var(--red-hover);
  transform: scale(1.1);
}

.qty b {
  min-width: 20px;
  text-align: center;
  font-size: 14px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: #555;
}

.cart-total strong {
  color: var(--dark);
  font-size: 24px;
  font-weight: 900;
}

/* ====== ADD MENU ROW ====== */
.add-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 160px;
  gap: 10px;
  margin-top: 16px;
}

.add-menu-row select,
.add-menu-row input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  outline: none;
  border-radius: var(--radius-md);
  background: #fafafa;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13px;
  color: var(--dark);
  transition: var(--transition);
}

.add-menu-row select:focus,
.add-menu-row input:focus,
#orderForm input:focus,
#orderForm textarea:focus {
  background: #fff8ea;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(243, 185, 0, 0.15);
}

.add-cart {
  background: var(--orange);
  color: var(--dark);
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  height: 52px;
  padding: 0 24px;
}

.add-cart {
  height: 52px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.add-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(243, 185, 0, 0.35);
  background: #e5ad00;
}

/* ===== BUTTON BASE ===== */
.add-cart,
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

/* ===== ICON WRAPPER ===== */
.btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== SVG ONLY ===== */
.btn-icon svg,
.submit-btn svg,
.add-cart svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ===== TEXT ALIGNMENT ===== */
.add-cart span,
.submit-btn span {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* ====== DIVIDER ====== */
.order-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

/* ====== ORDER FORM ====== */
#orderForm {
  display: block !important;
}

#orderForm h3 {
  margin-bottom: 16px;
}

.customer-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px;
}

.customer-grid label,
#orderForm .textarea {
  position: relative;
  display: block !important;
  grid-column: auto !important;
}

.customer-grid label svg,
#orderForm .textarea svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  color: var(--red);
  transform: translateY(-50%);
  z-index: 2;
}

#orderForm input,
#orderForm textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  border-radius: var(--radius-md);
  background: #fafafa;
  color: var(--dark);
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition);
}

#orderForm input {
  height: 54px;
  padding: 0 16px 0 47px;
}

#orderForm .textarea {
  margin-top: 12px;
}

#orderForm .textarea svg {
  top: 20px;
  transform: none;
}

#orderForm textarea {
  min-height: 110px;
  padding: 17px 17px 17px 47px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  height: 56px;
  margin-top: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  line-height: 1;
}

.submit-btn .btn-text {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.submit-btn .btn-text svg,
.submit-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.submit-btn:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 32, 39, 0.3);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.submit-btn.loading .spinner {
  display: inline-block;
}

.submit-btn.loading .btn-text {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ====== TOAST NOTIFICATION ====== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.success {
  background: #1a8c3a;
}

.toast.error {
  background: var(--red);
}

/* ====== RESPONSIVE - TABLET ====== */
@media (max-width: 820px) {
  .customer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .add-menu-row {
    grid-template-columns: 1fr 100px;
  }

  .add-cart {
    grid-column: 1 / 3;
    height: 50px;
  }
}

/* ====== RESPONSIVE - MOBILE ====== */
@media (max-width: 640px) {
  .order-phone {
    padding: 80px 14px 28px;
  }

  .topbar {
    height: 60px;
    padding: 8px 14px;
  }

  .brand {
    font-size: 10px;
    gap: 7px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .topbar-menu {
    gap: 3px;
    padding: 4px;
  }

  .topbar-menu a {
    padding: 8px 11px;
    font-size: 11px;
  }

  .order-hero {
    text-align: left;
  }

  .order-hero h1 {
    font-size: 26px;
  }

  .order-hero p {
    font-size: 13px;
  }

  .order-card {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .order-card-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .order-card-title h2 {
    font-size: 22px;
  }

  .back-menu {
    width: 100%;
    justify-content: center;
  }

  .cart-row {
    grid-template-columns: 60px 1fr 92px;
    gap: 10px;
    padding: 10px;
  }

  .cart-row img {
    width: 56px;
    height: 50px;
  }

  .cart-row h4 {
    font-size: 13px;
  }

  .cart-row small {
    font-size: 11px;
  }

  .qty {
    gap: 6px;
  }

  .qty button {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .cart-total strong {
    font-size: 20px;
  }

  .add-menu-row,
  .customer-grid {
    grid-template-columns: 1fr !important;
  }

  .add-cart {
    grid-column: auto;
    min-height: 50px;
  }

  .cart-area h3,
  #orderForm h3 {
    font-size: 18px;
  }

  .toast {
    bottom: 20px;
    font-size: 12px;
    padding: 12px 20px;
  }
}
