/* Mobile-First White Theme */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

html {
  scroll-behavior: smooth;
}

:root {
  --primary: #FF6B6B;
  --primary-dark: #E63946;
  --secondary: #4ECDC4;
  --secondary-light: #06D6D0;
  --light: #F8F9FA;
  --white: #FFFFFF;
  --gray-dark: #2F3E46;
  --gray-medium: #54626F;
  --gray-light: #D0DADF;
  --success: #06D6D0;
  --warning: #FFD60A;
  --error: #E63946;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--gray-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu {
  display: none;
  list-style: none;
  gap: 25px;
  flex: 1;
  margin-left: 40px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--gray-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.cart-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.cart-btn:active {
  transform: scale(0.95);
}

.cart-badge {
  background: var(--secondary);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  display: none;
  animation: pulse 1.5s ease-in-out infinite;
}

.cart-badge.active {
  display: inline-block;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 15px 40px;
  min-height: 100vh;
}

/* Header */
.page-header {
  text-align: center;
  margin-bottom: 30px;
  animation: slideUp 0.6s ease-out;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-dark);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p {
  color: var(--gray-medium);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Grid System */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  animation: fadeIn 0.6s ease-out 0.1s both;
}

/* Card */
.card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(255, 107, 107, 0.2);
}

.card-image {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image img {
  transform: scale(1.1);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 4px;
  line-height: 1.2;
}

.card-description {
  font-size: 0.75rem;
  color: var(--gray-medium);
  margin-bottom: 8px;
  line-height: 1.3;
  flex: 1;
}

.card-portion {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.card-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  flex: 1;
}

.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  flex: 1;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--gray-light);
  color: var(--gray-dark);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 107, 0.05);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  width: 100%;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.btn-large {
  padding: 12px 24px;
  font-size: 0.95rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header-close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  color: var(--gray-dark);
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s ease;
}

.modal-header-close:hover {
  color: var(--primary);
}

.modal-header {
  padding: 20px 15px 15px;
}

.modal-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--gray-medium);
  margin-bottom: 15px;
  line-height: 1.5;
}

.modal-section {
  margin-bottom: 15px;
}

.modal-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-section-content {
  font-size: 0.9rem;
  color: var(--gray-dark);
  line-height: 1.5;
}

.modal-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin: 15px 0;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light);
  border-radius: 8px;
  padding: 10px;
  margin: 15px 0;
}

.quantity-control button {
  background: var(--white);
  border: 1px solid var(--gray-light);
  color: var(--primary);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.quantity-control button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quantity-control input {
  flex: 1;
  background: transparent;
  border: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-dark);
}

.modal-actions {
  padding: 15px;
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* Cart Page */
.cart-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border-radius: 12px;
  animation: slideUp 0.6s ease-out;
}

.empty-icon {
  font-size: 60px;
  margin-bottom: 15px;
  animation: bounce 2s ease-in-out infinite;
}

.empty-state h2 {
  font-size: 1.3rem;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--gray-medium);
  margin-bottom: 20px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  background: var(--white);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 50px 1fr auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
  transition: all 0.3s ease;
}

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

.cart-item-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.cart-item-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  border-radius: 6px;
  padding: 4px 6px;
}

.cart-item-qty button {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  transition: all 0.2s ease;
}

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

.cart-item-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--gray-dark);
  font-size: 0.85rem;
}

.cart-item-total {
  font-weight: 700;
  color: var(--gray-dark);
  min-width: 70px;
  text-align: right;
  font-size: 0.9rem;
}

.cart-item-remove {
  background: rgba(230, 57, 70, 0.1);
  border: none;
  color: var(--error);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-remove:hover {
  background: var(--error);
  color: white;
  transform: scale(1.1);
}

/* Summary */
.summary {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  animation: slideUp 0.6s ease-out 0.1s both;
}

.summary h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--gray-dark);
}

.summary-row span:last-child {
  font-weight: 600;
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  padding-top: 15px;
  border-top: 2px solid var(--light);
  margin-top: 10px;
}

.select-shipping {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  margin: 10px 0;
  font-family: inherit;
  color: var(--gray-dark);
  background: var(--light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-shipping:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
}

.input-field {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  margin-bottom: 10px;
  font-family: inherit;
  color: var(--gray-dark);
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.input-field::placeholder {
  color: var(--gray-medium);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 107, 107, 0.02);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 15px;
  padding: 12px 16px;
  background: var(--white);
  color: var(--gray-dark);
  border-left: 4px solid var(--gray-light);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 3000;
  animation: slideInRight 0.4s ease-out;
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  border-left-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
  color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
  color: var(--warning);
}

/* Tablet */
@media (min-width: 768px) {
  .container {
    padding: 100px 25px 50px;
  }

  .page-header h1 {
    font-size: 2.2rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .card-image {
    height: 160px;
  }

  .nav-menu {
    display: flex;
  }

  .cart-wrapper {
    grid-template-columns: 1fr 340px;
  }

  .cart-item {
    grid-template-columns: 60px 1fr auto auto auto;
  }

  .cart-item-image {
    width: 60px;
    height: 60px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .container {
    padding: 110px 30px 60px;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }

  .card-image {
    height: 180px;
  }

  .modal-content {
    width: 600px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
