/* ============================================
   Magic Tiling Ltd — Custom Website
   Built for Zack & team, Auckland's tiling specialist
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #faf7f4;
  --bg-alt: #f0ebe5;
  --text: #1a1a1a;
  --text-light: #6b6259;
  --accent: #c75b39;
  --accent-dark: #a04a2e;
  --accent-light: #e8a48e;
  --secondary: #2d4a3e;
  --secondary-light: #3d6b5e;
  --white: #ffffff;
  --overlay: rgba(26, 26, 26, 0.55);
  --font: 'Outfit', sans-serif;
  --radius: 6px;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

p { margin-bottom: 1rem; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: var(--white);
  padding: 10px 0;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1001;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  transition: color var(--transition);
  white-space: nowrap;
}

.scrolled .logo-text {
  color: var(--text);
}

/* Desktop nav */
.nav-links {
  display: none;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--white);
  transition: color var(--transition);
  padding: 8px 0;
  display: block;
}

.scrolled .nav-links a {
  color: var(--text);
}

.nav-links a:hover {
  color: var(--accent-light);
}

.scrolled .nav-links a:hover {
  color: var(--accent);
}

/* Dropdown */
.has-dropdown {
  cursor: pointer;
}

.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown.open .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu a {
  color: var(--text) !important;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background: var(--bg-alt);
  color: var(--accent) !important;
}

.nav-cta {
  display: none;
}

.nav-cta a {
  background: var(--accent);
  color: var(--white) !important;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.nav-cta a:hover {
  background: var(--accent-dark);
  color: var(--white) !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all var(--transition);
  display: block;
}

.scrolled .nav-toggle span {
  background: var(--text);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  background: var(--text);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  background: var(--text);
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 999;
  padding: 100px 24px 40px;
  overflow-y: auto;
}

.mobile-menu.active {
  display: flex;
  flex-direction: column;
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu > ul > li {
  border-bottom: 1px solid var(--bg-alt);
}

.mobile-menu a {
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

.mobile-menu a:hover {
  color: var(--accent);
}

.mobile-dropdown-items {
  display: none;
  padding-left: 16px;
}

.mobile-dropdown-items.open {
  display: block;
}

.mobile-dropdown-items a {
  font-size: 1rem;
  font-weight: 400;
  padding: 12px 0;
  color: var(--text-light);
}

.mobile-menu-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-toggle::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-light);
  transition: transform var(--transition);
}

.mobile-menu-toggle.open::after {
  content: '−';
}

.mobile-menu .phone-cta {
  margin-top: auto;
  padding-top: 24px;
}

.mobile-menu .phone-cta a {
  display: block;
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.1rem;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 26, 26, 0.85) 0%,
    rgba(26, 26, 26, 0.4) 40%,
    rgba(26, 26, 26, 0.15) 70%,
    rgba(26, 26, 26, 0.05) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px 60px;
  max-width: 700px;
  width: 100%;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero .hero-sub {
  color: rgba(255,255,255,0.85);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font);
  min-height: 48px;
  min-width: 44px;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
  color: var(--white);
}

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

.btn-secondary:hover {
  background: var(--secondary-light);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--text);
  color: var(--white);
}

.btn-dark:hover {
  background: #333;
  color: var(--white);
}

/* --- Page Hero (for inner pages) --- */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.page-hero .hero-bg {
  position: absolute;
  inset: 0;
}

.page-hero .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 26, 26, 0.8) 0%,
    rgba(26, 26, 26, 0.3) 50%,
    rgba(26, 26, 26, 0.1) 100%
  );
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 20px 48px;
  max-width: 700px;
}

.page-hero h1 {
  color: var(--white);
  margin-bottom: 12px;
}

.page-hero .hero-sub {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* --- Section Spacing --- */
.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--text);
  color: var(--white);
}

.section-dark h2,
.section-dark h3 {
  color: var(--white);
}

.section-dark p {
  color: rgba(255,255,255,0.8);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.section-header .label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.05rem;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.service-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.service-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.8) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.service-card h3 {
  color: var(--white);
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.service-card p {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.service-card .card-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.service-card:hover .card-arrow {
  background: var(--accent);
}

.card-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
}

/* --- USP / Why Section --- */
.usp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.usp-item {
  text-align: center;
  padding: 24px 16px;
}

.usp-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.usp-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.usp-item h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.usp-item p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.testimonial-card {
  background: var(--white);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.testimonial-stars {
  color: #f5a623;
  font-size: 1rem;
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
  font-style: italic;
}

.testimonial-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.testimonial-source {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- CTA Band --- */
.cta-band {
  background: var(--secondary);
  padding: 60px 0;
  text-align: center;
}

.cta-band h2 {
  color: var(--white);
  margin-bottom: 12px;
}

.cta-band p {
  color: rgba(255,255,255,0.8);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-band .btn-primary {
  font-size: 1.1rem;
  padding: 16px 36px;
}

/* --- About page content --- */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.about-text h2 {
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-light);
  font-size: 1.05rem;
}

.about-image {
  border-radius: 8px;
  overflow: hidden;
}

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

/* --- Service Page Content --- */
.service-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.service-text h2 {
  margin-bottom: 16px;
}

.service-text p {
  color: var(--text-light);
  font-size: 1.02rem;
}

.service-image {
  border-radius: 8px;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.service-features {
  list-style: none;
  margin: 20px 0;
}

.service-features li {
  padding: 10px 0;
  padding-left: 28px;
  position: relative;
  color: var(--text-light);
  font-size: 1rem;
  border-bottom: 1px solid var(--bg-alt);
}

.service-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* --- Reviews section on service pages --- */
.review-highlight {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 32px;
  border-left: 4px solid var(--accent);
}

.review-highlight blockquote {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
  margin-bottom: 12px;
}

.review-highlight cite {
  font-style: normal;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.contact-info-card {
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.contact-info-card h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-detail-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.contact-detail-text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 2px;
  font-weight: 500;
}

.contact-detail-text a,
.contact-detail-text span {
  font-size: 1rem;
  color: var(--text);
}

.hours-list {
  list-style: none;
  margin-top: 12px;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--bg-alt);
}

.hours-list li:last-child {
  border-bottom: none;
}

.hours-list .day {
  font-weight: 500;
}

.hours-list .time {
  color: var(--text-light);
}

/* Contact form */
.contact-form {
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.contact-form h3 {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
  min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-submit {
  width: 100%;
}

.form-status {
  text-align: center;
  padding: 16px;
  margin-top: 16px;
  border-radius: var(--radius);
  display: none;
}

.form-status.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
}

.form-status.error {
  display: block;
  background: #fbe9e7;
  color: #c62828;
}

/* --- Footer --- */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col ul a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
}

/* --- Privacy / Legal Page --- */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.legal-content h1 {
  margin-bottom: 8px;
}

.legal-content .last-updated {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content p,
.legal-content li {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-content li {
  margin-bottom: 6px;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Sticky Phone Bar (Mobile) --- */
.sticky-phone {
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  z-index: 998;
  padding: 0;
}

.sticky-phone a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px;
  min-height: 48px;
}

.sticky-phone svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
}

/* Extra bottom padding on body to prevent content behind sticky bar */
body {
  padding-bottom: 56px;
}

/* --- Responsive --- */

/* Tablet */
@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .usp-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .section {
    padding: 80px 0;
  }

  .nav-links {
    display: flex;
  }

  .nav-cta {
    display: block;
  }

  .nav-toggle {
    display: none;
  }

  .sticky-phone {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

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

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

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

  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
  }

  .service-content {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
  }

  .service-content.reverse {
    direction: rtl;
  }

  .service-content.reverse > * {
    direction: ltr;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .hero-content {
    padding: 0 40px 80px;
  }

  .page-hero-content {
    padding: 0 40px 56px;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 100px 0;
  }

  .container {
    padding: 0 40px;
  }

  .header-inner {
    padding: 0 40px;
  }
}

/* Ensure no horizontal overflow at any width */
html, body {
  max-width: 100vw;
}

/* --- Print --- */
@media print {
  .site-header,
  .nav-toggle,
  .mobile-menu,
  .sticky-phone {
    display: none !important;
  }

  .hero {
    min-height: auto;
    break-after: page;
  }
}
