@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");
@import url("./theme.css");

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  background: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2rem, var(--container-lg));
  margin-inline: auto;
}

.product-container {
  width: min(100% - 2rem, var(--container-sm));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  height: var(--header-height);
  background: rgb(255 255 255 / 0.95);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.header-grid {
  height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--color-dark);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.icon-btn:hover { background: var(--color-secondary); }

.logo {
  height: 2.5rem;
  width: auto;
  margin-inline: auto;
  object-fit: contain;
}

.main-content {
  flex: 1;
  padding-block: 1rem 0;
}

.product-grid {
  display: grid;
  gap: 2rem;
}

.gallery-frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-secondary);
}

.gallery-track {
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
  min-width: 100%;
  height: 100%;
  scroll-snap-align: center;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.gallery-dot {
  width: 0.625rem;
  height: 0.625rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-border);
  cursor: pointer;
  transition: width var(--transition-fast), background var(--transition-fast);
}

.gallery-dot.is-active {
  width: 1.5rem;
  background: var(--color-dark);
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.thumbnail {
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-card);
  cursor: pointer;
}

.thumbnail.is-active { border-color: var(--color-gold); }

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  line-height: 1.65;
}

.price-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.price-current {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-dark);
}

.price-old {
  font-size: 1.125rem;
  color: var(--color-muted-foreground);
  text-decoration: line-through;
}

.discount-pill,
.verified-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
}

.discount-pill {
  padding: 0.25rem 0.75rem;
  background: var(--color-destructive);
  color: var(--color-white);
  font-size: var(--font-size-xs);
}

.rating-row {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stars { color: var(--color-gold-strong); letter-spacing: 0.08em; }
.muted { color: var(--color-muted-foreground); }

.offer-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--color-gold) 35%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-gold-soft) 85%, white);
  font-size: var(--font-size-sm);
}

.offer-box p { margin: 0.25rem 0; }
.offer-title { font-weight: 800; color: var(--color-dark); }
.danger { color: var(--color-destructive); font-weight: 700; }

.product-intro {
  margin: 1rem 0 0;
  font-size: var(--font-size-sm);
}

.form-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--font-size-sm);
}

.control {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-foreground);
  outline: none;
  text-align: right;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.control:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgb(205 160 99 / 0.18);
}

.buy-tools {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.btn {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
}

.btn:hover { transform: translateY(-1px); }

.btn-outline {
  border: 2px solid var(--color-dark);
  background: var(--color-card);
  color: var(--color-dark);
}

.btn-primary {
  width: 100%;
  margin-top: 0.75rem;
  border: 1px solid var(--color-dark);
  background: var(--color-dark);
  color: var(--color-white);
  min-height: 3.5rem;
}

.quantity {
  min-width: 7.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
}

.quantity button {
  width: 1.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}

.quantity span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 800;
}

.card-section {
  margin-top: 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-card);
}

.section-heading {
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
}

.description {
  margin-top: 1.25rem;
  line-height: 2;
}

.description h3 { margin: 1rem 0 0.25rem; }
.description p { margin: 0.5rem 0; }
.description ul { padding-inline-start: 1.5rem; }

.delivery-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(205 160 99 / 0.3);
  border-radius: var(--radius-sm);
  background: var(--color-gold-soft);
  color: var(--color-dark);
  font-weight: 700;
}

.reviews-section { margin-top: 2.5rem; }

.reviews-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.reviews-header h2 { margin: 0; font-size: 1.5rem; }

.review-list {
  display: grid;
  gap: 1rem;
}

.review-card {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
}

.review-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.verified-pill {
  padding: 0.25rem 0.75rem;
  background: var(--color-secondary);
  font-size: var(--font-size-xs);
}

.review-name {
  margin: 0.25rem 0 0;
  font-size: var(--font-size-sm);
  font-weight: 800;
}

.review-copy {
  margin: 0.75rem 0 0;
  color: var(--color-muted-foreground);
  font-size: var(--font-size-sm);
}

.mobile-buy-bar {
  position: sticky;
  inset-block-end: 0;
  z-index: 30;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-card);
}

.mobile-buy-bar .btn-primary { margin: 0; }

.site-footer {
  margin-top: 4rem;
  background: var(--color-dark);
  color: var(--color-white);
}

.footer-inner { padding-block: 3rem; }

.footer-grid {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem;
}

.footer-block {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.footer-block summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
}

.footer-links {
  margin-top: 0.75rem;
  color: rgb(255 255 255 / 0.7);
  font-size: var(--font-size-sm);
}

.footer-links p { margin: 0.35rem 0; }

.footer-center {
  padding-block: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  text-align: center;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 999px;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  text-align: center;
  font-size: var(--font-size-sm);
}

.footer-bottom p { margin: 0.4rem 0; }

.whatsapp-fab {
  position: fixed;
  inset-inline-start: 1rem;
  inset-block-end: 6rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--color-whatsapp);
  color: white;
  box-shadow: var(--shadow-float);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #F6EFE5, #E8D7C4);
  color: var(--color-muted-foreground);
  text-align: center;
}

@media (min-width: 768px) {
  .main-content { padding-block-start: 1.5rem; }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .footer-block {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .mobile-buy-bar { display: none; }

  .whatsapp-fab { inset-block-end: 1rem; }
}

@media (max-width: 520px) {
  .buy-tools { grid-template-columns: minmax(0, 1fr) 7rem; }
  .thumbnails { grid-template-columns: repeat(5, minmax(3.25rem, 1fr)); overflow-x: auto; }
}

/* Checkout page */
.checkout-main {
  padding-block: 1.5rem 0;
}

.checkout-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  line-height: 1.5;
}

.checkout-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.checkout-form {
  min-width: 0;
}

.checkout-card {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-card);
}

.checkout-card-title {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.checkout-fields {
  display: grid;
  gap: 1rem;
}

.checkout-field-wide {
  grid-column: 1 / -1;
}

.checkout-notes {
  margin-top: 1rem;
}

.required {
  color: var(--color-destructive);
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-muted-foreground);
  font-size: var(--font-size-xs);
}

.checkout-submit {
  margin-top: 1.5rem;
}

.payment-methods-preview {
  min-height: 3rem;
  display: grid;
  place-items: center;
  margin-top: 1rem;
}

.payment-methods-preview img {
  max-width: min(100%, 32rem);
  max-height: 3rem;
  object-fit: contain;
}

.payments-placeholder {
  width: min(100%, 32rem);
  padding: 0.75rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-muted-foreground);
  background: var(--color-card);
  text-align: center;
  font-size: var(--font-size-xs);
}

.payment-integration-note {
  margin: 0.75rem auto 0;
  color: var(--color-muted-foreground);
  font-size: var(--font-size-xs);
  text-align: center;
}

.order-summary {
  height: fit-content;
}

.summary-product {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.summary-image {
  width: 5rem;
  height: 5rem;
  flex: 0 0 5rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-secondary);
}

.summary-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-image .placeholder-image {
  padding: 0.25rem;
  font-size: 0.65rem;
}

.summary-product-info {
  min-width: 0;
  flex: 1;
  font-size: var(--font-size-sm);
}

.summary-product-info p {
  margin: 0 0 0.25rem;
}

.summary-product-title {
  font-weight: 700;
}

.summary-custom strong {
  color: var(--color-foreground);
  overflow-wrap: anywhere;
}

.summary-item-price {
  flex-shrink: 0;
  white-space: nowrap;
}

.summary-lines {
  display: grid;
  gap: 0.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.summary-line,
.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.free-shipping {
  color: #15803D;
  font-weight: 700;
}

.delivery-line {
  color: var(--color-destructive);
  font-weight: 700;
}

.summary-total {
  padding-top: 1rem;
  font-size: var(--font-size-lg);
  font-weight: 800;
}

.footer-tax {
  color: rgb(255 255 255 / 0.7);
}

.footer-payment-image {
  height: 2.5rem;
  width: auto;
  margin: 0.75rem auto 0;
  object-fit: contain;
}

.order-modal[hidden] {
  display: none;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(15 17 21 / 0.55);
  backdrop-filter: blur(4px);
}

.order-modal-card {
  position: relative;
  width: min(100%, 30rem);
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--color-card);
  box-shadow: var(--shadow-float);
  text-align: center;
}

.order-modal-card h2 {
  margin: 0.75rem 0 0.5rem;
}

.order-modal-card p {
  margin: 0;
  color: var(--color-muted-foreground);
}

.order-modal-card .btn {
  margin-top: 1.5rem;
}

.order-modal-close {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-secondary);
  color: var(--color-dark);
  font-size: 1.5rem;
  cursor: pointer;
}

.order-success-icon {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  margin-inline: auto;
  border-radius: 999px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 2rem;
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .checkout-card {
    padding: 1.5rem;
  }

  .checkout-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr) 23.75rem;
  }

  .order-summary {
    position: sticky;
    top: 5rem;
  }
}

/* Standalone payment page */
.payment-page {
  min-height: 100vh;
  background: #F6F9FC;
  color: #425466;
}

.payment-shell {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
  padding-block: 1.5rem;
}

.payment-layout {
  display: grid;
  gap: 0;
}

.payment-summary-panel {
  min-width: 0;
}

.payment-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  color: #635BFF;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.payment-to {
  margin: 0;
  font-size: var(--font-size-sm);
}

.payment-to strong,
.payment-product-name,
.payment-grand-total,
.payment-card-panel h1,
.payment-product-price {
  color: #1A1F36;
}

.payment-main-total {
  margin: 0.5rem 0 0;
  color: #1A1F36;
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.payment-currency {
  font-size: 1.5rem;
}

.payment-product-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #D9E2EC;
}

.payment-product-image {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  border-radius: 0.375rem;
  object-fit: cover;
  background: white;
}

.payment-product-copy {
  min-width: 0;
  flex: 1;
  font-size: var(--font-size-sm);
}

.payment-product-copy p {
  margin: 0 0 0.25rem;
}

.payment-product-copy p:not(.payment-product-name) {
  font-size: var(--font-size-xs);
}

.payment-product-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-product-price {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.payment-price-lines {
  padding-block: 1rem;
  font-size: var(--font-size-sm);
}

.payment-price-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-block: 0.25rem;
}

.payment-price-lines .payment-grand-total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #D9E2EC;
  font-weight: 800;
}

.payment-card-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #FFFFFF;
  box-shadow:
    0 15px 35px rgb(50 50 93 / 0.10),
    0 5px 15px rgb(0 0 0 / 0.07);
}

.payment-card-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.payment-card-heading h1 {
  margin: 0;
  font-size: 1.125rem;
}

.payment-card-logos {
  height: 2rem;
  width: auto;
  max-width: min(100%, 15rem);
  object-fit: contain;
}

.payment-form {
  display: grid;
  gap: 1rem;
}

.payment-label > span {
  display: block;
  margin-bottom: 0.375rem;
  color: #1A1F36;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.payment-input-wrap,
.payment-card-fields {
  overflow: hidden;
  border: 1px solid #D8DEE9;
  border-radius: 0.5rem;
  background: #FFFFFF;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.payment-input-wrap:focus-within,
.payment-card-fields:focus-within {
  border-color: #635BFF;
  box-shadow: 0 0 0 3px rgb(99 91 255 / 0.18);
}

.payment-input-wrap input,
.payment-card-fields input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 0;
  background: transparent;
  color: #1A1F36;
  outline: none;
}

.payment-card-fields > input {
  border-bottom: 1px solid #D8DEE9;
}

.payment-card-fields-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-card-fields-bottom input:first-child {
  border-inline-end: 1px solid #D8DEE9;
}

.payment-security-note {
  margin: -0.25rem 0 0;
  color: #697386;
  font-size: var(--font-size-xs);
  line-height: 1.7;
}

.payment-submit {
  min-height: 3rem;
  border: 0;
  border-radius: 0.5rem;
  background: #635BFF;
  color: #FFFFFF;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.payment-submit:hover {
  background: #5851DB;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .payment-shell {
    padding-block: 1.5rem;
  }

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

  .payment-summary-panel {
    padding-top: 2rem;
  }

  .payment-card-panel {
    margin-top: 2rem;
    padding: 2rem;
  }
}
