/* ===== VARIABLES ===== */
:root {
  /* Colors */
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --primary-light: #fdEDEC;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --success: #27ae60;
  --warning: #e67e22;
  --error: #e74c3c;
  
  /* Neutrals */
  --white: #ffffff;
  --light: #f8f9fa;
  --light-gray: #e9ecef;
  --gray: #6c757d;
  --dark: #2c3e50;
  --black: #212529;
  
  /* Typography */
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Roboto Slab', serif;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}

/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
  overflow-x: hidden;
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-md);
  background: var(--primary);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-popover);
  transition: var(--transition-base);
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

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

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--success {
  background: var(--success);
  color: var(--white);
}

.btn--success:hover:not(:disabled) {
  background: #219653;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--light-gray);
}

.btn--outline:hover:not(:disabled) {
  background: var(--light);
  border-color: var(--gray);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-fixed);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo__icon {
  font-size: 1.75rem;
  animation: spin 20s linear infinite;
}

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

.logo__text {
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.cart-opener {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--primary);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
}

.cart-opener:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.cart-opener__count {
  background: var(--white);
  color: var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6)), url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--white);
  padding: 120px 0 80px;
  margin-top: 70px;
  text-align: center;
}

.hero__content {
  max-width: 600px;
}

.hero__title {
  font-family: var(--font-secondary);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.hero__description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: var(--space-2xl);
  opacity: 0.9;
}

/* ===== PIZZAS SECTION ===== */
.pizzas-section {
  padding: var(--space-2xl) 0;
}

.pizzas-section__title {
  font-family: var(--font-secondary);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: var(--space-2xl);
  position: relative;
}

.pizzas-section__title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary);
  margin: var(--space-md) auto 0;
  border-radius: 2px;
}

.pizzas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
  align-items: start;
}

/* ===== PIZZA CARD ===== */
.pizza-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pizza-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.pizza-card__image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.pizza-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-base);
}

.pizza-card:hover .pizza-card__img {
  transform: scale(1.05);
}

.pizza-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-base);
}

.pizza-card:hover .pizza-card__overlay {
  opacity: 1;
}

.pizza-card__overlay span {
  color: var(--white);
  font-weight: 500;
  background: var(--primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}

.pizza-card__add {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  transition: var(--transition-base);
  box-shadow: var(--shadow-md);
}

.pizza-card__add:hover {
  background: var(--primary-dark);
  transform: translate(-50%, -50%) scale(1.1);
}

.pizza-card__content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pizza-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.pizza-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.pizza-card__description {
  color: var(--gray);
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
}

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
}

.cart-sidebar[aria-hidden="false"] {
  right: 0;
}

.cart-sidebar__content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--light-gray);
  flex-shrink: 0;
}

.cart-sidebar__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.cart-sidebar__close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--light-gray);
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-sidebar__close:hover {
  background: var(--gray);
  color: var(--white);
}

.cart-sidebar__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-empty {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--gray);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cart-empty__message {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.cart-empty__hint {
  font-size: 0.875rem;
}

.cart-items {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  display: none;
}

.cart-summary {
  padding: var(--space-lg);
  border-top: 1px solid var(--light-gray);
  background: var(--light);
  flex-shrink: 0;
  display: none;
}

.cart-summary__item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  color: var(--dark);
}

.cart-summary__item--total {
  border-top: 1px solid var(--light-gray);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
}

.cart-summary__checkout {
  width: 100%;
  margin-top: var(--space-lg);
}

/* ===== CART ITEM ===== */
.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
}

.cart-item__image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__info {
  flex: 1;
}

.cart-item__name {
  font-weight: 500;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.cart-item__controls {
  display: inline-flex;
  background: var(--light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cart-item__btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__btn:hover {
  background: var(--light-gray);
}

.cart-item__quantity {
  width: 30px;
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__remove {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--light-gray);
  border-radius: 50%;
  font-size: 1.125rem;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item__remove:hover {
  background: var(--error);
  color: var(--white);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  overflow-y: auto;
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 1;
  background: var(--white);
  border: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.modal__close:hover {
  background: var(--light);
}

/* ===== PIZZA DETAIL ===== */
.pizza-detail {
  display: flex;
  flex-direction: column;
}

.pizza-detail__image {
  background: var(--light);
  padding: var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.pizza-detail__img {
  max-height: 250px;
  width: auto;
  max-width: 100%;
}

.pizza-detail__info {
  padding: var(--space-2xl);
}

.pizza-detail__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.pizza-detail__description {
  color: var(--gray);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.pizza-detail__sizes {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
}

.pizza-detail__legend {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
  color: var(--dark);
}

.sizes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--light-gray);
}

.size-option {
  cursor: pointer;
}

.size-option__input {
  position: absolute;
  opacity: 0;
}

.size-option__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--white);
  transition: var(--transition-base);
  text-align: center;
  height: 100%;
}

.size-option__input:checked + .size-option__label {
  background: var(--primary);
  color: var(--white);
}

.size-option__input:focus + .size-option__label {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.size-option__name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
}

.size-option__description {
  font-size: 0.75rem;
  opacity: 0.8;
}

.pizza-detail__price {
  margin-bottom: var(--space-xl);
}

.pizza-detail__price-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
  color: var(--dark);
}

.price-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.price-controls__amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.quantity-selector {
  display: inline-flex;
  background: var(--light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 50px;
}

.quantity-selector__btn {
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-selector__btn:hover {
  background: var(--light-gray);
}

.quantity-selector__value {
  width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pizza-detail__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ===== NOTIFICATION ===== */
.notification {
  position: fixed;
  top: 90px;
  right: var(--space-md);
  background: var(--success);
  color: var(--white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  transform: translateX(400px);
  transition: transform var(--transition-base);
  max-width: 300px;
}

.notification.show {
  transform: translateX(0);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-lg);
  }
  
  .pizza-detail {
    flex-direction: row;
  }
  
  .pizza-detail__image {
    flex: 1;
    min-height: auto;
  }
  
  .pizza-detail__info {
    flex: 1;
  }
  
  .pizza-detail__actions {
    flex-direction: row;
  }
  
  .pizza-detail__actions .btn {
    flex: 1;
  }
}

@media (min-width: 768px) {
  .modal__close--mobile {
    display: none;
  }
  
  .pizza-detail__image {
    padding: var(--space-2xl);
  }
  
  .pizza-detail__img {
    max-height: 350px;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 140px 0 100px;
  }
  
  .pizzas-section {
    padding: var(--space-2xl) 0;
  }
}

@media (max-width: 767px) {
  .modal {
    padding: 0;
    align-items: stretch;
  }
  
  .modal__content {
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  .pizza-detail__image {
    padding: var(--space-xl);
    min-height: 200px;
  }
  
  .pizza-detail__img {
    max-height: 150px;
  }
  
  .pizza-detail__info {
    padding: var(--space-xl);
  }
  
  .sizes-grid {
    grid-template-columns: 1fr;
  }
  
  .price-controls {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  
  .quantity-selector {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .header__container {
    padding: 0 var(--space-sm);
  }
  
  .logo__text {
    font-size: 1.25rem;
  }
  
  .cart-opener {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.875rem;
  }
  
  .cart-opener__count {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }
  
  .pizzas-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .hero {
    padding: 100px 0 60px;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* ===== PRINT STYLES ===== */
@media print {
  .header,
  .cart-sidebar,
  .modal,
  .btn {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  
  .container {
    max-width: none;
  }
}