/* ============================================================
   layout.css — Page-Level Layout Structures
   Sulekha Kitchenware — B2B Catalogue
   ============================================================ */

/* ── Grid Systems ─────────────────────────────────────────── */

/* Generic responsive grid */
.grid {
  display: grid;
  gap: var(--sp-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-fill responsive grids */
.grid-auto-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-6);
}

.grid-auto-md {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-6);
}

/* Flex Utilities */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ── Navbar Layout ────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border-light);
  height: 72px;
  display: flex;
  align-items: center;
  transition: box-shadow var(--transition-base);
}

#navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
}

.navbar-logo-name {
  font-family: var(--ff-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
  letter-spacing: -0.02em;
}

.navbar-logo-tag {
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--clr-secondary);
  letter-spacing: 0.04em;
}

.navbar-logo-name span {
  color: var(--clr-accent);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.navbar-nav a {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
  position: relative;
}

.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-smooth);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--clr-primary);
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
  width: 100%;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.navbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.navbar-hamburger:hover { background: var(--clr-bg-section); }

.hamburger-line {
  width: 22px;
  height: 2px;
  background: var(--clr-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-smooth);
}

/* Mobile Nav Menu */
.navbar-mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  padding: var(--sp-6);
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: var(--sp-4);
}

.navbar-mobile-menu.open {
  display: flex;
}

.navbar-mobile-menu a {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--clr-primary);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--clr-border-light);
  transition: color var(--transition-fast);
}

.navbar-mobile-menu a:hover { color: var(--clr-accent); }
.navbar-mobile-menu a:last-of-type { border-bottom: none; }

/* ── Hero Layout ──────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

/* The container inside hero grows to fill available space */
#hero > .container {
  flex: 1;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1556909114-f6e7ad7d3136?w=1600&q=85');
  background-size: cover;
  background-position: center;
  animation: heroZoom 18s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 10, 0.72) 0%,
    rgba(10, 10, 10, 0.45) 60%,
    rgba(196, 122, 44, 0.12) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-accent);
  background: rgba(196, 122, 44, 0.12);
  border: 1px solid rgba(196, 122, 44, 0.3);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
  animation: fadeSlideDown 0.8s ease 0.2s both;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, var(--fs-5xl));
  font-weight: var(--fw-extrabold);
  color: var(--clr-white);
  line-height: 1.12;
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
  animation: fadeSlideUp 0.8s ease 0.4s both;
}

.hero-title span {
  color: var(--clr-accent);
}

.hero-subtitle {
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  color: rgba(255,255,255,0.8);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-10);
  max-width: 520px;
  animation: fadeSlideUp 0.8s ease 0.55s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  animation: fadeSlideUp 0.8s ease 0.7s both;
}

.hero-stats {
  position: absolute;
  bottom: var(--sp-10);
  left: 0;
  right: 0;
  z-index: 2;
}

.hero-stats-inner {
  display: flex;
  gap: var(--sp-10);
  animation: fadeSlideUp 0.8s ease 0.85s both;
}

.hero-stat {
  color: var(--clr-white);
}

.hero-stat-number {
  font-family: var(--ff-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  line-height: 1;
  margin-bottom: var(--sp-1);
}

.hero-stat-number span { color: var(--clr-accent); }

.hero-stat-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Category Grid Layout ─────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

/* ── Product Grid Layout ──────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

/* ── Product Detail Layout ────────────────────────────────── */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: start;
}

/* ── Enquiry Section Layout ───────────────────────────────── */
.enquiry-section {
  background: var(--clr-bg-section);
  border-radius: var(--radius-xl);
  padding: var(--sp-16) var(--sp-12);
  text-align: center;
}

/* ── Trust Bar Layout ─────────────────────────────────────── */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
}

/* ── Footer Layout ────────────────────────────────────────── */
#footer {
  background: var(--clr-bg-dark);
  color: rgba(255,255,255,0.75);
}

.footer-top {
  padding: var(--sp-20) 0 var(--sp-12);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--sp-12);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom {
  padding: var(--sp-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.footer-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-credit {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.footer-credit-link {
  color: rgba(255,255,255,0.55);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-credit-link:hover {
  color: var(--clr-accent);
}

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--clr-bg-dark);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.admin-main {
  flex: 1;
  background: var(--clr-bg-section);
  overflow-x: hidden;
}

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid    { grid-template-columns: repeat(2, 1fr); }
  .footer-top    { grid-template-columns: 1fr 1fr; gap: var(--sp-10); }
  .product-detail-layout { grid-template-columns: 1fr; gap: var(--sp-8); }
}

@media (max-width: 768px) {
  .navbar-nav       { display: none; }
  .navbar-hamburger { display: flex; }
  #nav-cta-btn      { display: none; }
  .category-grid    { grid-template-columns: 1fr; }
  .products-grid    { grid-template-columns: repeat(2, 1fr); }
  .enquiry-section  { padding: var(--sp-10) var(--sp-6); }

  /* Hero — stats must not overlap content; pull out of absolute flow */
  .hero-stats {
    position: static;
    padding: var(--sp-8) 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
    flex-shrink: 0;
  }
  .hero-stats-inner {
    gap: var(--sp-6);
    flex-wrap: wrap;
  }
  /* Give hero container enough top padding on mobile */
  #hero > .container {
    padding-top: var(--sp-12);
    padding-bottom: var(--sp-8);
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .products-grid    { grid-template-columns: 1fr; }
  .trust-grid       { grid-template-columns: 1fr; }
  .footer-top       { grid-template-columns: 1fr; gap: var(--sp-8); }
  .footer-bottom    { flex-direction: column; gap: var(--sp-3); text-align: center; }
  .hero-actions     { flex-direction: column; align-items: flex-start; }
  .admin-sidebar    { display: none; }

  /* CTA strip — stack buttons vertically so nothing overflows */
  .cta-strip-actions {
    flex-direction: column;
    width: 100%;
  }
  .cta-strip-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
