/* ============================================
   ESTAÇÃO DO HEXA - Style Sheet
   Clean, static, performant
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: 'Rethink Sans', sans-serif;
  font-size: 1.5rem;
  line-height: 1.6;
  color: #101010;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1.5rem;
}

/* --- Utilities --- */
.page-width {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 750px) {
  .page-width {
    padding: 0 4rem;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 3rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn--primary {
  background-color: #101010;
  color: #f0f0f0;
  border-color: #101010;
}

.btn--primary:hover {
  background-color: #303030;
  border-color: #303030;
  opacity: 1;
}

.btn--secondary {
  background-color: transparent;
  color: #101010;
  border-color: #101010;
}

.btn--secondary:hover {
  background-color: #101010;
  color: #f0f0f0;
  opacity: 1;
}

.btn--full {
  width: 100%;
}

.btn--small {
  padding: 0.8rem 1.6rem;
  font-size: 1.2rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Header --- */
.header {
  background-color: #101010;
  color: #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
  gap: 2rem;
}

.header__logo img {
  height: 36px;
  width: auto;
}

.header__nav {
  display: none;
  gap: 2.4rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.header__nav a:hover {
  opacity: 0.7;
}

@media (min-width: 990px) {
  .header__nav {
    display: flex;
  }
  .header__menu-toggle {
    display: none;
  }
}

.header__cart {
  position: relative;
  display: flex;
  align-items: center;
  color: #f0f0f0;
}

.header__cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__menu-toggle {
  color: #f0f0f0;
  display: flex;
  align-items: center;
}

@media (min-width: 990px) {
  .header__menu-toggle {
    display: none;
  }
}

.header__mobile-nav {
  display: none;
  flex-direction: column;
  background: #101010;
  padding: 1rem 1.5rem 2rem;
  gap: 1.2rem;
  font-size: 1.5rem;
  font-weight: 600;
  border-top: 1px solid #303030;
}

.header__mobile-nav.open {
  display: flex;
}

.header__checkout-label {
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #909090;
}

.header--white {
  background-color: #ffffff;
  color: #101010;
  border-bottom: 1px solid #e5e5e5;
}

.header--white .header__checkout-label {
  color: #606060;
}

.header--white .header__nav a,
.header--white .header__cart,
.header--white .header__menu-toggle {
  color: #101010;
}

.header--white .header__mobile-nav {
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  color: #101010;
}

/* --- Cart Page --- */
.cart-page {
  padding-top: 4rem;
  padding-bottom: 6rem;
  flex: 1;
}

.cart-page__title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

/* Empty Cart */
.cart-empty {
  text-align: center;
  padding: 6rem 0;
}

.cart-empty svg {
  margin-bottom: 2rem;
}

.cart-empty p {
  font-size: 1.6rem;
  color: #909090;
  margin-bottom: 2.4rem;
}

/* Cart Content */
.cart-content {
  display: grid;
  gap: 4rem;
}

@media (min-width: 750px) {
  .cart-content {
    grid-template-columns: 1fr 360px;
    gap: 4rem;
  }
}

/* Cart Items */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.6rem;
  padding: 2rem 0;
  border-bottom: 1px solid #e5e5e5;
  align-items: start;
}

.cart-item:first-child {
  border-top: 1px solid #e5e5e5;
}

.cart-item__image {
  width: 90px;
  height: 90px;
  object-fit: cover;
  background: #f5f5f5;
}

.cart-item__details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cart-item__title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: #101010;
}

.cart-item__variant {
  font-size: 1.3rem;
  color: #909090;
}

.cart-item__price {
  font-size: 1.5rem;
  font-weight: 600;
  color: #101010;
}

.cart-item__actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.6rem;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  border: 1px solid #d4d4d4;
}

.cart-item__qty button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #101010;
  transition: background 0.15s;
}

.cart-item__qty button:hover {
  background: #f0f0f0;
}

.cart-item__qty input {
  width: 40px;
  height: 32px;
  text-align: center;
  border: none;
  border-left: 1px solid #d4d4d4;
  border-right: 1px solid #d4d4d4;
  font-size: 1.4rem;
  font-weight: 600;
}

.cart-item__qty input:focus {
  outline: none;
}

.cart-item__remove {
  font-size: 1.2rem;
  color: #909090;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.cart-item__remove:hover {
  color: #ef4444;
}

/* Cart Summary */
.cart-summary {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  padding: 2.4rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  font-size: 1.6rem;
}

.cart-summary__subtotal {
  font-weight: 700;
  font-size: 1.8rem;
}

.cart-summary__shipping {
  font-size: 1.3rem;
  color: #909090;
  margin-bottom: 2rem;
}

.cart-summary .btn {
  margin-bottom: 1rem;
}

/* --- Checkout Page --- */
.checkout-page {
  padding-top: 4rem;
  padding-bottom: 6rem;
  flex: 1;
}

.checkout-grid {
  display: grid;
  gap: 4rem;
}

@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr 380px;
  }
}

/* Checkout Steps */
.checkout-steps {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.checkout-step.active {
  opacity: 1;
}

.checkout-step.completed {
  opacity: 0.7;
}

.checkout-step__number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #101010;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-step.active .checkout-step__number {
  background: #101010;
}

.checkout-step__label {
  font-size: 1.3rem;
  font-weight: 600;
}

/* Checkout Form */
.checkout-form__title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.checkout-fieldset {
  border: none;
  padding: 0;
}

.checkout-fieldset__legend {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #101010;
}

.form-row {
  margin-bottom: 1.6rem;
}

.form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group--grow {
  flex: 2;
}

.form-group--small {
  flex: 0.5;
}

.form-group label {
  font-size: 1.3rem;
  font-weight: 600;
  color: #303030;
}

.form-group input,
.form-group select {
  padding: 1.2rem 1.4rem;
  border: 1px solid #d4d4d4;
  font-size: 1.5rem;
  transition: border-color 0.2s;
  background: #fff;
  color: #101010;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #101010;
}

.form-group input.error,
.form-group select.error {
  border-color: #ef4444;
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid #d4d4d4;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-method:has(input:checked) {
  border-color: #101010;
  background: #fafafa;
}

.payment-method input {
  accent-color: #101010;
}

.payment-method__label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Credit Card Fields */
.credit-card-fields {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}

/* Payment Result */
.payment-result {
  text-align: center;
  padding: 4rem 0;
}

.payment-result h2 {
  font-size: 2.2rem;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
}

.payment-result p {
  font-size: 1.5rem;
  color: #606060;
  margin-bottom: 2rem;
}

.pix-code {
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  padding: 1.6rem;
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pix-code code {
  font-size: 1.2rem;
  word-break: break-all;
  color: #303030;
}

/* Checkout Summary */
.checkout-summary {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  padding: 2.4rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.checkout-summary__title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #e5e5e5;
}

.checkout-summary__items {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.checkout-summary__item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.checkout-summary__item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #f0f0f0;
}

.checkout-summary__item-name {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.checkout-summary__item-qty {
  font-size: 1.2rem;
  color: #909090;
}

.checkout-summary__item-price {
  font-size: 1.4rem;
  font-weight: 600;
  white-space: nowrap;
}

.checkout-summary__totals {
  border-top: 1px solid #e5e5e5;
  padding-top: 1.6rem;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.checkout-summary__row--total {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
}

/* --- Footer --- */
.footer {
  background: #ffffff;
  color: #101010;
  padding: 4rem 0 0;
  margin-top: auto;
  border-top: 1px solid #e5e5e5;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 750px) {
  .footer__inner {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer__col h4 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.footer__col a {
  font-size: 1.3rem;
  color: #606060;
  transition: color 0.2s;
}

.footer__col a:hover {
  color: #101010;
  opacity: 1;
}

.footer__desc {
  font-size: 1.3rem;
  color: #606060;
  line-height: 1.5;
}

.footer__bottom {
  border-top: 1px solid #e5e5e5;
  padding: 1.6rem 0;
  text-align: center;
}

.footer__bottom p {
  font-size: 1.2rem;
  color: #909090;
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f0f0f0;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 749px) {
  .cart-page__title {
    font-size: 2.2rem;
  }

  .checkout-form__title {
    font-size: 2rem;
  }

  .form-row--2col {
    grid-template-columns: 1fr;
  }

  .checkout-steps {
    gap: 0.6rem;
  }

  .checkout-step__label {
    font-size: 1.1rem;
  }
}
