/* GreyandGrema Carpets - Main Stylesheet */
:root {
  --white: #ffffff;
  --off-white: #faf8f6;
  --gold: #8c6d3f;
  --gold-dark: #70562f;
  --gold-light: #f5efe8;
  --text: #1c1a17;
  --text-soft: #5e574f;
  --border: #e8e2da;
  --danger: #b00020;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Jost', Arial, sans-serif;
  --shadow-sm: 0 1px 3px rgba(28, 26, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 26, 23, 0.06);
  --radius-sm: 2px;
  --radius-md: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { width: min(1200px, 92%); margin-inline: auto; }
.hidden { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1.5rem; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 2rem 0 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-solid:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: var(--gold-light); }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo-link { display: inline-flex; align-items: center; }
.logo { height: 40px; width: auto; max-width: 180px; object-fit: contain; }
.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: none; border: none;
  color: var(--gold); cursor: pointer; border-radius: 50%;
  transition: background-color 0.2s;
}
.icon-btn:hover { background: var(--gold-light); }
.cart-link { text-decoration: none; }
.cart-count {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--gold); color: #fff;
  font-size: 0.65rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.search-overlay {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 1rem 0; display: none;
}
.search-overlay.open { display: block; }
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
  flex: 1; padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 0.95rem; outline: none;
}
.search-form input[type="search"]:focus { border-color: var(--gold); }

.mobile-menu {
  position: fixed; top: 70px; left: 0; right: 0; bottom: 0;
  background: #fff; z-index: 99; padding: 2rem 5%;
  transform: translateX(100%); transition: transform 0.25s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ul { display: flex; flex-direction: column; gap: 1.5rem; }
.mobile-menu a {
  font-size: 1.2rem; font-weight: 400; color: var(--text);
  border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--gold); }

/* Hero */
.hero { background: var(--off-white); border-bottom: 1px solid var(--border); }
.hero-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  align-items: center; min-height: 300px; padding: 2rem 0;
}
.hero-content { max-width: 550px; }
.hero-eyebrow {
  font-size: 0.85rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 0.5rem;
}
.hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.75rem; }
.hero-text { color: var(--text-soft); font-size: 1rem; margin-bottom: 1.25rem; }
.hero-media { display: flex; justify-content: flex-end; }
.hero-media img { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius-md); }

/* Categories */
.categories-section { padding: 3rem 0 1rem; }
.category-tabs {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
}
.category-tab {
  padding: 0.5rem 1rem; font-family: var(--sans); font-size: 0.9rem;
  font-weight: 500; background: none; border: none; color: var(--text-soft);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.category-tab:hover { color: var(--gold); }
.category-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* Product grid */
.products-section { padding: 2rem 0 4rem; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.product-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: box-shadow 0.25s;
}
.product-card:hover { box-shadow: var(--shadow-md); }
.product-image-link { display: block; overflow: hidden; background: var(--off-white); }
.product-image-link img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .product-image-link img { transform: scale(1.02); }
.product-body { padding: 0.75rem; }
.product-name { font-family: var(--sans); font-weight: 500; font-size: 0.9rem; line-height: 1.3; margin-bottom: 0.25rem; }
.product-name a { color: inherit; }
.product-name a:hover { color: var(--gold); }
.product-price { font-weight: 600; color: var(--gold-dark); font-size: 0.9rem; margin-bottom: 0.5rem; }
.add-to-cart {
  width: 100%; padding: 0.5rem 0.75rem; font-size: 0.8rem;
}
/* Out of stock */
.out-of-stock-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--danger); color: #fff; padding: 0.25rem 0.75rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  border-radius: var(--radius-sm); z-index: 2;
}
.product-card .add-to-cart:disabled {
  background: #ccc; border-color: #ccc; cursor: not-allowed;
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.3rem; margin-top: 2rem; flex-wrap: wrap; }
.page-btn {
  min-width: 38px; height: 38px; padding: 0 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 0.85rem; cursor: pointer; border-radius: 50%;
  transition: all 0.2s;
}
.page-btn:hover:not(.active):not(:disabled) { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Product detail */
.product-detail-page { padding: 2rem 0 4rem; }
.breadcrumb { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--gold); }
.breadcrumb span { margin: 0 0.25rem; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.product-gallery { display: grid; grid-template-columns: 80px 1fr; gap: 1rem; }
.thumbnails { display: flex; flex-direction: column; gap: 0.5rem; }
.thumbnail {
  width: 80px; height: 80px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  opacity: 0.7; transition: opacity 0.2s, border-color 0.2s;
}
.thumbnail.active, .thumbnail:hover { opacity: 1; border-color: var(--gold); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.main-image { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--off-white); }
.main-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product-info h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.5rem; }
.product-info .price { font-size: 1.5rem; font-weight: 600; color: var(--gold-dark); margin-bottom: 1rem; }
.product-info .description { color: var(--text-soft); margin-bottom: 1.5rem; line-height: 1.7; }
.option-group { margin-bottom: 1.25rem; }
.option-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem; }
.color-options { display: flex; gap: 0.5rem; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
  transition: border-color 0.2s;
}
.color-swatch.active { border-color: var(--gold); }
.size-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.size-option {
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s;
}
.size-option.active { border-color: var(--gold); color: var(--gold); background: var(--gold-light); }
.quantity-selector { display: flex; align-items: center; gap: 0.5rem; }
.quantity-btn {
  width: 36px; height: 36px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 1.2rem; line-height: 1;
  border-radius: var(--radius-sm);
}
.quantity-btn:hover { border-color: var(--gold); color: var(--gold); }
.quantity-input {
  width: 50px; height: 36px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 0.9rem;
}
.add-to-cart-detail { margin-top: 1.5rem; width: 100%; padding: 0.9rem; font-size: 1rem; }
.add-to-cart-detail:disabled {
  background: #ccc; border-color: #ccc; cursor: not-allowed;
}

/* Related products */
.related-products { margin-top: 4rem; }

/* Cart */
.cart-page { padding: 2rem 0 5rem; }
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 1rem; }
.cart-item {
  display: grid; grid-template-columns: 100px 1fr auto; gap: 1rem;
  padding: 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff;
}
.cart-item-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-details h3 { font-family: var(--sans); font-size: 1rem; font-weight: 500; margin-bottom: 0.25rem; }
.cart-item-meta { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.5rem; }
.cart-item-price { font-weight: 600; color: var(--gold-dark); }
.cart-item-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.remove-item { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.85rem; text-decoration: underline; }
.cart-summary { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.5rem; background: #fff; position: sticky; top: 90px; }
.cart-summary h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 0.75rem; font-size: 0.95rem; }
.summary-row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.empty-cart { text-align: center; padding: 3rem 0; color: var(--text-soft); }

/* Checkout */
.checkout-page { padding: 2rem 0 5rem; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
.checkout-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.5rem; }
.checkout-form h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.35rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--sans); font-size: 0.95rem;
  outline: none; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--gold); }
.order-summary { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.5rem; position: sticky; top: 90px; }
.order-summary h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.order-summary-item { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.5rem; }
.checkout-note { font-size: 0.8rem; color: var(--text-soft); margin-top: 1rem; text-align: center; }

/* Thank you */
.thankyou-page { padding: 4rem 0; text-align: center; max-width: 700px; }
.thankyou-page h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.thankyou-page p { color: var(--text-soft); margin-bottom: 1.5rem; }
.thankyou-details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.5rem; margin: 1.5rem 0; text-align: left; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0; }
.footer-brand p { margin-top: 1rem; color: var(--text-soft); font-size: 0.9rem; }
.footer-logo { height: 36px; }
.footer-links h4 { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; margin-bottom: 1rem; letter-spacing: 0.03em; }
.footer-links ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text-soft); font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1rem 0; text-align: center; font-size: 0.85rem; color: var(--text-soft); }

/* Toast notifications (added) */
.gg-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.gg-toast {
  pointer-events: auto;
  background: #fff;
  border: 1px solid #e8e2da;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(28,26,23,0.08);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: gg-toast-in 0.3s ease forwards;
  font-family: 'Jost', Arial, sans-serif;
}
.gg-toast.success { border-left: 4px solid #8c6d3f; }
.gg-toast.error { border-left: 4px solid #b00020; }
.gg-toast.info { border-left: 4px solid #5e574f; }
.gg-toast-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: bold; font-size: 14px;
}
.gg-toast.success .gg-toast-icon { background: #f5efe8; color: #8c6d3f; }
.gg-toast.error .gg-toast-icon { background: #fdecea; color: #b00020; }
.gg-toast.info .gg-toast-icon { background: #f0efed; color: #5e574f; }
.gg-toast-message { font-size: 14px; line-height: 1.4; color: #1c1a17; }
.gg-toast-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: #5e574f; padding: 0;
}
@keyframes gg-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes gg-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}
.gg-toast.removing { animation: gg-toast-out 0.3s ease forwards; }
@media (max-width: 480px) {
  .gg-toast-container { left: 20px; right: 20px; align-items: stretch; }
  .gg-toast { width: 100%; }
}

/* Responsive */
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; min-height: auto; }
  .hero-media { display: none; }
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .order-summary { position: static; }
}
@media (max-width: 600px) {
  .header-inner { height: 60px; }
  .logo { height: 32px; max-width: 140px; }
  .mobile-menu { top: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .product-gallery { grid-template-columns: 1fr; }
  .thumbnails { flex-direction: row; overflow-x: auto; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
/* Collapsible category toggle */
.category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.category-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.category-arrow {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.category-toggle.open .category-arrow {
  transform: rotate(180deg);
}

/* Legal pages */
.legal-page {
  max-width: 800px;
  padding: 2rem 0 5rem;
}
.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}
.legal-page h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.legal-page h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
}
.legal-page p,
.legal-page li {
  color: var(--text-soft);
  line-height: 1.8;
}
.legal-date {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Consent group (checkbox left, text right) */
.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.consent-group input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.consent-group label {
  display: inline;
  font-weight: 400;
  margin-bottom: 0;
}
.legal-link {
  color: var(--gold);
  text-decoration: underline;
  font-weight: 500;
}
.legal-link:hover {
  color: var(--gold-dark);
}

/* Delivery method options */
.delivery-method-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.delivery-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 0.95rem;
}
.delivery-option input[type="radio"] {
  width: auto;
  margin: 0;
}
.delivery-option:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-light);
}

/* Delivery message */
.delivery-message {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.sale-section { background: var(--off-white); padding: 3rem 0; }
.sale-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.sale-banner-content { flex: 1 1 320px; }
.sale-banner-text { color: var(--text-soft); margin: 0.5rem 0 1.25rem; }
.sale-banner-media { flex: 1 1 320px; max-width: 480px; }
.sale-banner-media img { width: 100%; border-radius: var(--radius-md); object-fit: cover; max-height: 320px; }
@media (max-width: 700px) {
  .sale-banner-inner { flex-direction: column; text-align: center; }
}

.sale-hero { background: var(--off-white); border-bottom: 1px solid var(--border); }
.sale-hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; min-height: 260px; padding: 2rem 0; }
.sale-hero-content { max-width: 550px; }
.sale-hero-eyebrow { font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--danger); margin-bottom: 0.5rem; }
.sale-hero-title { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin-bottom: 0.5rem; }
.sale-hero-text { color: var(--text-soft); margin-bottom: 1rem; }
.sale-hero-media img { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--radius-md); }
.sale-hero-countdown { margin-bottom: 1rem; color: var(--text-soft); font-size: 0.9rem; }
.sale-hero-countdown strong { color: var(--danger); }

@media (max-width: 900px) {
  .sale-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .sale-hero-media { display: none; }
}

.whatsapp-input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.whatsapp-prefix {
  background: var(--off-white);
  padding: 0.75rem 1rem;
  color: var(--text-soft);
  font-weight: 500;
  border-right: 1px solid var(--border);
}
.whatsapp-input-group input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0.75rem;
}
.whatsapp-input-group input:focus {
  outline: none;
  border-color: var(--gold);
}