/* ========== VERVE SCHOOL UNIFORM ORDER SYSTEM ========== */
:root {
  --primary: #5F6F52;       /* Dark olive green */
  --primary-dark: #4D5A43;
  --primary-light: #9FB8A0; /* Light sage green */
  --accent: #8B4A2B;        /* Rust/terracotta */
  --accent-light: #B07A50;  /* Warm copper */
  --cream: #DDD4C0;         /* Cream/beige */
  --bg: #FAF8F5;
  --white: #FFFFFF;
  --text: #2D2D2D;
  --text-light: #666666;
  --border: #DDD4C0;
  --success: #5F6F52;
  --error: #8B4A2B;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ========== HEADER ========== */
.header {
  background: var(--white);
  color: var(--text);
  padding: 1.25rem 2rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-bottom: 3px solid var(--accent);
}
.header-logo {
  height: 72px;
  margin-bottom: 0.25rem;
}
.header h1 {
  display: none; /* Hidden when logo is present */
}
.header .subtitle {
  font-size: 0.9rem;
  color: var(--primary);
  margin-top: 0.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.header-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-top: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ========== LANDING PAGE ========== */
.landing-container {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.landing-container h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.landing-container p {
  color: var(--text-light);
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}
.school-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 600px) {
  .school-cards { grid-template-columns: 1fr; }
}
.school-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--text);
}
.school-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--accent);
}
.school-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.school-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ========== NOTICE BAR ========== */
.notice-bar {
  background: #F5EDE4;
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.5rem;
  max-width: 960px;
  margin: 1.5rem auto 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--accent);
}

/* ========== ORDER FORM PAGE ========== */
.order-container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}

/* Learner Info Section */
.info-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.info-section h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input,
.form-group select {
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 122, 82, 0.15);
}

/* ========== PRODUCT CARDS ========== */
.products-section {
  margin-bottom: 2rem;
}
.products-section h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
  border: 2px solid transparent;
}
.product-card.has-items {
  border-color: var(--primary);
  background: #F5F9F4;
}
.product-card.poa-item {
  opacity: 0.65;
  background: #FAFAFA;
}
.product-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: #F5F2EE;
  padding: 4px;
  flex-shrink: 0;
}
.product-info {
  flex: 1;
  min-width: 0;
}
.product-info h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
  color: var(--text);
}
.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.product-price.poa {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  font-style: italic;
}
.product-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.btn-add {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-add:hover { background: var(--primary-dark); }
.btn-add:disabled { background: #CCC; cursor: not-allowed; }

.product-added-items {
  width: 100%;
  padding: 0;
}
.product-added-items:empty { display: none; }
.added-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: rgba(95, 111, 82, 0.08);
  border-radius: 6px;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}
.added-detail {
  flex: 1;
  color: var(--primary-dark);
  font-weight: 500;
}
.added-price {
  font-weight: 700;
  color: var(--accent);
}
.added-remove {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.added-remove:hover { color: var(--error); }
.product-size-select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 110px;
  background: var(--white);
  cursor: pointer;
}
.product-size-select:focus {
  border-color: var(--primary);
  outline: none;
}
.product-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.qty-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--text);
}
.qty-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.qty-input {
  width: 44px;
  text-align: center;
  padding: 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-logo { height: 56px; }
  .header { padding: 1rem; }

  .landing-container { margin: 2rem auto; }
  .landing-container h2 { font-size: 1.5rem; }

  .order-container { padding: 0 1rem 6rem; }

  .info-section { padding: 1.25rem; }
  .info-section h2 { font-size: 1.1rem; }

  .product-card {
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.75rem;
  }
  .product-img {
    width: 56px;
    height: 56px;
  }
  .product-controls {
    width: 100%;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
  }
  .product-size-select {
    flex: 1;
    min-width: 0;
  }
  .btn-add {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .school-cards { gap: 1rem; }
  .school-card { padding: 1.5rem 1rem; }
  .school-card h3 { font-size: 1.2rem; }

  .form-group input,
  .form-group select {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* ========== ORDER SUMMARY / CART ========== */
.order-summary {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  position: sticky;
  bottom: 0;
  border-top: 3px solid var(--accent);
  margin-top: 2rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}
.summary-row.total {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.summary-items {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
}
.btn-pay {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 1rem;
  letter-spacing: 0.5px;
}
.btn-pay:hover {
  background: var(--primary-dark);
}
.btn-pay:disabled {
  background: #CCC;
  cursor: not-allowed;
}

/* ========== SUCCESS PAGE ========== */
.success-container {
  max-width: 600px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.success-container h2 {
  color: var(--success);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.success-container p {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.order-ref {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}
.order-ref strong {
  display: block;
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-top: 0.5rem;
}
.btn-back {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.btn-back:hover { background: var(--primary-dark); }

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ========== LOADING ========== */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  background: white;
  padding: 2rem 3rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: 1.1rem;
  color: var(--primary-dark);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
