/* ==================== RESET & BASE STYLES ==================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* ==================== HEADER ==================== */

.order-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #fff;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo h1 {
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: #c44620;
}

.header-tagline {
  font-size: 0.85rem;
  color: #aaa;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.cart-toggle {
  background: linear-gradient(135deg, #c44620, #e85d32);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.cart-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 70, 32, 0.4);
}

.cart-icon {
  font-size: 1.3rem;
}

.cart-count {
  background: #1a1a1a;
  padding: 0.2rem 0.6rem;
  border-radius: 50%;
  font-size: 0.8rem;
  min-width: 20px;
  text-align: center;
}

/* ==================== MAIN CONTAINER ==================== */

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ==================== MENU SECTION ==================== */

.menu-section {
  background: #fff;
  border-radius: 15px;
  padding: 3rem 2.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.menu-header {
  text-align: center;
  margin-bottom: 3rem;
}

.menu-header h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 2.2rem;
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.menu-header p {
  color: #c44620;
  font-size: 1rem;
}

/* ==================== CATEGORY TABS ==================== */

.category-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.category-btn {
  background: #f5f5f5;
  border: 2px solid transparent;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  color: #333;
}

.category-btn:hover {
  background: #efefef;
}

.category-btn.active {
  background: linear-gradient(135deg, #c44620, #e85d32);
  color: #fff;
  border-color: #c44620;
}

/* ==================== MENU GRID ==================== */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.menu-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.menu-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-8px);
  border-color: #c44620;
}

.menu-item-image-wrapper {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-placeholder {
  font-size: 4rem;
  color: #ddd;
  position: absolute;
  z-index: 1;
}

.menu-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f0f0f0;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-item-image.loaded {
  opacity: 1;
}

.menu-item-content {
  padding: 1.5rem;
}

.menu-item-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.menu-item-description {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.menu-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-item-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #c44620;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, #c44620, #e85d32);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(196, 70, 32, 0.4);
}

/* ==================== CART SIDEBAR ==================== */

.cart-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #fff;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c44620;
}

.cart-header h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.5rem;
}

.close-cart {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-cart:hover {
  transform: rotate(90deg);
  color: #c44620;
}

/* ==================== ORDER TYPE SELECTOR ==================== */

.order-type-selector {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.order-type-selector h3 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.order-type-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.order-type-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.order-type-option input[type="radio"] {
  cursor: pointer;
  width: 20px;
  height: 20px;
  accent-color: #c44620;
}

.order-type-option:has(input:checked) {
  border-color: #c44620;
  background: rgba(196, 70, 32, 0.05);
}

.option-label {
  display: flex;
  flex-direction: column;
}

.option-title {
  font-weight: 700;
  color: #1a1a1a;
}

.option-time {
  font-size: 0.85rem;
  color: #666;
}

/* ==================== CART ITEMS ==================== */

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-cart {
  text-align: center;
  color: #999;
  padding: 2rem 0;
  font-size: 0.95rem;
}

.cart-item {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 10px;
  border-left: 4px solid #c44620;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.cart-item-name {
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #c44620;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.cart-item-remove:hover {
  transform: scale(1.2);
}

.cart-item-details {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.8rem;
}

.cart-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 0.3rem 0.5rem;
}

.quantity-btn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #c44620;
  font-weight: 700;
}

.quantity-display {
  min-width: 25px;
  text-align: center;
  font-weight: 600;
  color: #333;
}

.cart-item-price {
  font-weight: 700;
  color: #c44620;
}

/* ==================== COUPON SECTION ==================== */

.coupon-section {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.coupon-section h3 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.coupon-input-group {
  display: flex;
  gap: 0.5rem;
}

.coupon-input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
}

.coupon-input:focus {
  outline: none;
  border-color: #c44620;
  box-shadow: 0 0 0 3px rgba(196, 70, 32, 0.1);
}

.apply-coupon {
  padding: 0.8rem 1.2rem;
  background: #c44620;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.apply-coupon:hover {
  background: #b73916;
}

.coupon-message {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  min-height: 20px;
}

.coupon-message.success {
  color: #27ae60;
}

.coupon-message.error {
  color: #e74c3c;
}

/* ==================== ORDER SUMMARY ==================== */

.order-summary {
  padding: 1.5rem;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  color: #666;
  font-size: 0.95rem;
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  border-top: 2px solid #ddd;
  padding-top: 0.8rem;
  margin-bottom: 0;
}

/* ==================== CHECKOUT BUTTON ==================== */

.checkout-btn {
  padding: 1.2rem;
  background: linear-gradient(135deg, #c44620, #e85d32);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.checkout-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(196, 70, 32, 0.4);
}

.checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.cart-terms {
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  padding: 0 1.5rem 1.5rem;
}

/* ==================== CART OVERLAY ==================== */

.cart-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  transition: all 0.3s ease;
}

.cart-overlay.visible {
  display: block;
}

/* ==================== MODAL ==================== */

.modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #c44620;
  transition: all 0.3s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
}

.product-detail {
  padding: 2rem;
}

.product-detail-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-detail-image.loaded {
  opacity: 1;
}

.product-detail-name {
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.product-detail-price {
  font-size: 1.5rem;
  color: #c44620;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-detail-description {
  color: #666;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.product-options {
  margin-bottom: 1.5rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-group h4 {
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #1a1a1a;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
}

.option-item input {
  margin-right: 0.8rem;
  accent-color: #c44620;
}

.option-item label {
  flex: 1;
  cursor: pointer;
}

.product-detail-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.quantity-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f5f5f5;
  padding: 0.8rem;
  border-radius: 10px;
}

.quantity-input button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #c44620;
  font-weight: 700;
}

.quantity-input input {
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.add-to-order-btn {
  flex: 1;
  padding: 1rem;
  background: linear-gradient(135deg, #c44620, #e85d32);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-to-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 70, 32, 0.4);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .order-header {
    padding: 1rem 0;
  }

  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  .header-logo h1 {
    font-size: 1.5rem;
  }

  .category-tabs {
    flex-direction: column;
  }

  .category-btn {
    width: 100%;
  }

  .menu-section {
    padding: 1.5rem 1rem;
  }

  .main-container {
    padding: 1rem;
  }

  .modal-content {
    width: 95%;
  }

  .product-detail-footer {
    flex-direction: column;
  }

  .quantity-input {
    width: 100%;
  }

  .add-to-order-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
  }

  .cart-count {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  .order-type-options {
    gap: 0.5rem;
  }

  .order-type-option {
    padding: 0.75rem;
  }
}
