/*
 * EasyPro Employee Apparel Store
 * Session 4 cart styles
 */

.ep-cart-link {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.ep-cart-count {
  display: inline-flex;
  min-width: 1.4rem;
  min-height: 1.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #0f5f8f;
  color: #ffffff;
}

.ep-add-to-cart-panel,
.ep-cart-review-note,
.ep-cart-empty,
.ep-cart-summary,
.ep-cart-disabled-checkout {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #d9e3ea;
  border-radius: 12px;
  background: #ffffff;
}

.ep-add-to-cart-panel h2 {
  margin-top: 0;
}

.ep-add-to-cart-panel form {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
}

.ep-add-to-cart-panel label {
  font-weight: 700;
}

.ep-add-to-cart-panel select,
.ep-add-to-cart-panel input,
.ep-cart-qty input {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #bccbd6;
  border-radius: 8px;
}

.ep-add-to-cart-panel button,
.ep-cart-summary button,
.ep-cart-remove,
.ep-cart-qty button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  background: #0f5f8f;
  color: #ffffff;
}

.ep-cart-notice,
.ep-cart-message,
.ep-cart-review-note,
.ep-cart-disabled-checkout {
  color: #334155;
}

.ep-cart-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
}

.ep-cart-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.ep-cart-table th,
.ep-cart-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #d9e3ea;
  text-align: left;
  vertical-align: middle;
}

.ep-cart-table th {
  background: #f4f8fb;
}

.ep-cart-qty {
  display: grid;
  grid-template-columns: auto 70px auto;
  gap: 0.35rem;
  align-items: center;
}

.ep-cart-qty input {
  text-align: center;
}

.ep-cart-summary {
  text-align: right;
}

.ep-cart-disabled-checkout {
  background: #f8fafc;
  font-weight: 700;
}

@media (max-width: 700px) {
  .ep-cart-summary {
    text-align: left;
  }
}

/* Session 5 checkout preparation styles */

.ep-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  background: #0f5f8f;
  color: #ffffff;
}

.ep-button:hover,
.ep-button:focus {
  text-decoration: none;
}

.ep-button-secondary {
  background: #e8f1f7;
  color: #0f3f5f;
}

.ep-checkout-placeholder {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #d9e3ea;
  border-radius: 12px;
  background: #ffffff;
}

.ep-checkout-placeholder h2 {
  margin-top: 0;
}

.ep-checkout-placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Session 5 cart polish */

#ep-cart-page {
  margin-top: 1.5rem;
}

.ep-cart-shell {
  display: grid;
  gap: 1.25rem;
}

.ep-cart-review-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-left: 5px solid #0f5f8f;
  background: #f4f9fc;
}

.ep-cart-review-note strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0f3f5f;
}

.ep-cart-review-note p,
.ep-cart-disabled-checkout p {
  margin: 0.25rem 0 0;
  font-weight: 400;
}

.ep-cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}

.ep-cart-items {
  display: grid;
  gap: 1rem;
}

.ep-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid #d9e3ea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 63, 95, 0.08);
}

.ep-cart-item-kicker {
  margin: 0 0 0.35rem;
  color: #60758a;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ep-cart-item h2 {
  margin: 0;
  color: #123047;
  font-size: 1.2rem;
  line-height: 1.25;
}

.ep-cart-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.ep-cart-meta div {
  padding: 0.7rem;
  border-radius: 12px;
  background: #f7fafc;
}

.ep-cart-meta dt {
  margin-bottom: 0.15rem;
  color: #60758a;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ep-cart-meta dd {
  margin: 0;
  color: #123047;
  font-weight: 700;
}

.ep-cart-item-side {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.ep-cart-price-block,
.ep-cart-line-total,
.ep-cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.ep-cart-price-block span,
.ep-cart-line-total span,
.ep-cart-summary-row span {
  color: #60758a;
  font-weight: 700;
}

.ep-cart-price-block strong,
.ep-cart-line-total strong,
.ep-cart-summary-row strong {
  color: #123047;
}

.ep-cart-line-total {
  padding-top: 0.75rem;
  border-top: 1px solid #d9e3ea;
}

.ep-cart-summary {
  position: sticky;
  top: 1rem;
  margin-top: 0;
  text-align: left;
  box-shadow: 0 10px 26px rgba(15, 63, 95, 0.08);
}

.ep-cart-summary h2 {
  margin-top: 0;
  color: #123047;
}

.ep-cart-summary-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #d9e3ea;
}

.ep-cart-summary-total {
  margin-bottom: 1rem;
  border-bottom: 0;
  font-size: 1.2rem;
}

.ep-cart-disabled-checkout {
  margin-top: 1rem;
  border-color: #c8dce8;
  background: #f4f9fc;
}

.ep-cart-clear,
.ep-cart-remove {
  width: 100%;
}

.ep-cart-remove {
  background: #e8f1f7;
  color: #0f3f5f;
}

.ep-cart-clear {
  margin-top: 1rem;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  background: #123047;
  color: #ffffff;
}

.ep-cart-empty {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 26px rgba(15, 63, 95, 0.08);
}

.ep-cart-empty-icon {
  font-size: 2rem;
}

.ep-cart-empty h2 {
  margin: 0;
  color: #123047;
}

.ep-cart-empty p {
  margin: 0 0 0.5rem;
}

@media (max-width: 900px) {
  .ep-cart-layout {
    grid-template-columns: 1fr;
  }

  .ep-cart-summary {
    position: static;
  }

  .ep-cart-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .ep-cart-meta {
    grid-template-columns: 1fr;
  }

  .ep-cart-qty {
    grid-template-columns: 44px minmax(80px, 1fr) 44px;
  }
}

/* Session 5 page shell fallback
 * These styles clean up cart/checkout pages when they are using the simple fallback header.
 */

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #123047;
  background: #f5f8fb;
  border-top: 3px solid #1f3b2f;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: #ffffff;
  border-bottom: 1px solid #d9e3ea;
  box-shadow: 0 4px 18px rgba(15, 63, 95, 0.06);
}

.site-header > a {
  color: #123047;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header nav a {
  color: #123047;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus {
  color: #0f5f8f;
}

.site-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.page-hero {
  margin-bottom: 1.5rem;
  padding: 1.75rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6fb 100%);
  border: 1px solid #d9e3ea;
  box-shadow: 0 10px 26px rgba(15, 63, 95, 0.08);
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  color: #123047;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: #40576b;
  font-size: 1.05rem;
  line-height: 1.55;
}

@media (max-width: 650px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    flex-wrap: wrap;
  }

  .site-main {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .page-hero {
    padding: 1.25rem;
  }
}


/* Session 5 fallback header match */

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.site-brand-mark {
  display: inline-block;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f5f8f 0%, #6ea84f 100%);
}

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 0;
  box-shadow: none;
}

body {
  border-top: 0;
}

body::before {
  content: "";
  display: block;
  height: 0;
}

@media (min-width: 651px) {
  .site-header {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Session 5 cart/checkout alignment correction */

.site-header {
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding-left: max(1rem, calc((100vw - 1180px) / 2));
  padding-right: max(1rem, calc((100vw - 1180px) / 2));
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
  background: #ffffff;
  border-bottom: 1px solid #d9e3ea;
}

.site-main {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.page-hero,
.ep-cart-shell,
.ep-checkout-placeholder {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 651px) {
  .site-header {
    padding-left: max(1rem, calc((100vw - 1180px) / 2));
    padding-right: max(1rem, calc((100vw - 1180px) / 2));
  }
}

/* Session 6 checkout form foundation */

.ep-checkout-warning {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid #c8dce8;
  border-left: 5px solid #0f5f8f;
  border-radius: 14px;
  background: #f4f9fc;
}

.ep-checkout-warning strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0f3f5f;
}

.ep-checkout-warning p {
  margin: 0;
  color: #40576b;
}

.ep-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.25rem;
  align-items: start;
}

.ep-checkout-form-card,
.ep-checkout-summary-card {
  padding: 1.25rem;
  border: 1px solid #d9e3ea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 63, 95, 0.08);
}

.ep-checkout-form-card h2,
.ep-checkout-summary-card h2 {
  margin-top: 0;
  color: #123047;
}

.ep-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ep-form-field {
  display: grid;
  gap: 0.35rem;
}

.ep-form-field-full {
  grid-column: 1 / -1;
}

.ep-form-field label {
  color: #123047;
  font-weight: 800;
}

.ep-optional {
  color: #60758a;
  font-size: 0.85rem;
  font-weight: 600;
}

.ep-form-field input,
.ep-form-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bccbd6;
  border-radius: 10px;
  padding: 0.75rem;
  color: #123047;
  font: inherit;
  background: #ffffff;
}

.ep-form-field input:focus,
.ep-form-field textarea:focus {
  outline: 3px solid rgba(15, 95, 143, 0.18);
  border-color: #0f5f8f;
}

.ep-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.ep-form-actions button {
  border: 0;
  cursor: pointer;
}

.ep-checkout-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
}

.ep-checkout-message ul {
  margin: 0;
  padding-left: 1.25rem;
}

.ep-checkout-message-error {
  border: 1px solid #e4b4b4;
  background: #fff5f5;
  color: #7a1d1d;
}

.ep-checkout-message-success {
  border: 1px solid #b9dcc2;
  background: #f3fbf5;
  color: #1f5d31;
}

.ep-checkout-summary-items {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.ep-checkout-summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #d9e3ea;
}

.ep-checkout-summary-item div {
  display: grid;
  gap: 0.2rem;
}

.ep-checkout-summary-item span {
  color: #60758a;
  font-size: 0.92rem;
}

.ep-checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #d9e3ea;
}

.ep-checkout-summary-total {
  border-bottom: 0;
  font-size: 1.2rem;
}

.ep-checkout-summary-note,
.ep-checkout-empty {
  color: #40576b;
}

.ep-checkout-empty {
  display: grid;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .ep-checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .ep-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Session 7 checkout validation messages */
.checkout-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d8dee8;
    background: #f8fafc;
}

.checkout-message ul {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
}

.checkout-message--success {
    border-color: #b7e2c3;
    background: #f0fff4;
}

.checkout-message--error {
    border-color: #f2b8b5;
    background: #fff5f5;
}

.checkout-message--working {
    border-color: #b7d4f6;
    background: #f0f7ff;
}
