/* ============================================
   Madex Marcenaria e Carpintaria - Main Styles
   Fonts: Cormorant Garamond + Space Grotesk
   Colors: #ffffff, #d2ae6d
   ============================================ */

/* --- CSS Variables --- */
:root {
  --gold: #d2ae6d;
  --gold-light: #e8d4a8;
  --gold-dark: #b8944f;
  --white: #ffffff;
  --off-white: #faf8f5;
  --cream: #f5f0e8;
  --dark: #1a1a1a;
  --dark-light: #2d2d2d;
  --gray: #6b6b6b;
  --gray-light: #9a9a9a;
  --gray-lighter: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 40px rgba(210, 174, 109, 0.2);
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Space Grotesk', sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--dark);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; color: var(--dark); }
h1 { font-size: 36px; margin-bottom: 20px; }
h2 { font-size: 24px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 12px; }
p { margin-bottom: 16px; }

/* --- Utility Classes --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-light { background: var(--off-white); }
.section-cream { background: var(--cream); }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Preloader --- */
.preloader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--white); display: flex; align-items: center; justify-content: center;
  z-index: 99999; transition: opacity 0.5s, visibility 0.5s;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-spinner {
  width: 50px; height: 50px; border: 3px solid var(--gray-lighter);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Header & Navigation --- */
.header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(98, 47, 16, 0.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(210, 174, 109, 0.15);
  transition: var(--transition);
}
.header a { color: var(--white); }
.header a:hover { color: var(--gold); }
.header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 1200px; margin: 0 auto;
}
.logo img { height: 50px; width: auto; filter: brightness(1.2); }
.nav-desktop { display: flex; align-items: center; gap: 0; }
.nav-desktop > ul { display: flex; align-items: center; gap: 0; }
.nav-desktop > ul > li {
  position: relative;
}
.nav-desktop > ul > li > a {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 12px; font-size: 14px; font-family: var(--font-body);
  font-weight: 500; color: var(--white); text-transform: uppercase;
  letter-spacing: 0.5px; transition: var(--transition);
  white-space: nowrap;
}
.nav-desktop > ul > li > a:hover,
.nav-desktop > ul > li.active > a { color: var(--gold); }
.nav-desktop > ul > li > a .icon { font-size: 14px; opacity: 0.7; }

/* Submenu indicator arrow */
.has-submenu > a::after {
  content: ''; display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid currentColor; margin-left: 4px;
  transition: var(--transition);
}
.has-submenu:hover > a::after { transform: rotate(180deg); }

/* Submenu - vertical with icons */
.submenu {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: var(--white); border: 1px solid rgba(210, 174, 109, 0.2);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: var(--transition); padding: 8px 0; z-index: 100;
}
.has-submenu:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 13px; color: var(--dark);
  transition: var(--transition);
}
.submenu li a .sub-icon { font-size: 16px; color: var(--gold); width: 20px; text-align: center; }
.submenu li a:hover { background: var(--cream); color: var(--gold); padding-left: 24px; }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px; background: var(--white);
  transition: var(--transition);
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Nav */
.nav-mobile {
  display: none; position: fixed; top: 74px; left: 0; width: 100%; height: calc(100vh - 74px);
  background: var(--white); overflow-y: auto; padding: 20px;
  transform: translateX(-100%); transition: var(--transition); z-index: 999;
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile ul { display: flex; flex-direction: column; }
.nav-mobile > ul > li > a {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 0; font-size: 16px; font-weight: 500;
  border-bottom: 1px solid var(--gray-lighter); color: var(--dark);
}
.nav-mobile .submenu {
  position: static; opacity: 1; visibility: visible; transform: none;
  box-shadow: none; border: none; padding: 0 0 0 20px;
  display: none; background: transparent;
}
.nav-mobile .submenu.open { display: block; }
.nav-mobile .submenu li a { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }

/* --- Hero Section --- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  overflow: hidden; margin-top: 74px;
}
.hero-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
}
.hero-bg::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(26,26,26,0.85) 0%, rgba(26,26,26,0.4) 100%);
}
.hero-content {
  position: relative; z-index: 2; max-width: 700px; padding: 40px;
  animation: fadeInUp 1s ease-out;
}
.hero-content h1 { color: var(--white); font-size: 48px; margin-bottom: 20px; }
.hero-content p { color: rgba(255,255,255,0.9); font-size: 18px; margin-bottom: 30px; }
.hero-content .btn { margin-right: 12px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; font-family: var(--font-body); font-size: 14px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  border: 2px solid var(--gold); border-radius: var(--radius);
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--dark); }
.btn-dark { background: var(--dark); color: var(--white); border-color: var(--dark); }
.btn-dark:hover { background: var(--dark-light); transform: translateY(-2px); }

/* --- Cards --- */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: var(--transition); position: relative;
}
.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
}
.card-img {
  width: 100%; height: 240px; object-fit: cover;
  transition: var(--transition);
}
.card:hover .card-img { transform: scale(1.05); }
.card-img-wrapper { overflow: hidden; position: relative; }
.card-img-wrapper::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  opacity: 0; transition: var(--transition);
}
.card:hover .card-img-wrapper::after { opacity: 1; }
.card-body { padding: 24px; }
.card-body h3 { font-size: 20px; margin-bottom: 8px; }
.card-body p { color: var(--gray); font-size: 14px; margin-bottom: 16px; }
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--gold); text-transform: uppercase;
}
.card-link:hover { gap: 10px; }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* --- Features / Services Section --- */
.feature-card {
  text-align: center; padding: 40px 24px; background: var(--white);
  border-radius: var(--radius-lg); transition: var(--transition);
  border: 1px solid rgba(210,174,109,0.1);
}
.feature-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}
.feature-icon {
  width: 70px; height: 70px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border-radius: 50%;
  font-size: 28px; color: var(--gold); transition: var(--transition);
}
.feature-card:hover .feature-icon { background: var(--gold); color: var(--white); transform: scale(1.1); }
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--gray); }

/* --- About Section --- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-img { border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.about-img img { width: 100%; height: 400px; object-fit: cover; }
.about-img::before {
  content: ''; position: absolute; top: -10px; left: -10px;
  width: 100px; height: 100px; border: 3px solid var(--gold);
  border-radius: var(--radius); z-index: -1;
}
.about-content h2 { font-size: 32px; margin-bottom: 20px; }
.about-content p { color: var(--gray); margin-bottom: 16px; }
.about-stats { display: flex; gap: 30px; margin-top: 30px; }
.stat-item { text-align: center; }
.stat-number { font-family: var(--font-heading); font-size: 36px; color: var(--gold); font-weight: 700; }
.stat-label { font-size: 13px; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; }

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  padding: 80px 0; text-align: center; position: relative; overflow: hidden;
}
.cta-section::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(210,174,109,0.1) 0%, transparent 70%);
}
.cta-section h2 { color: var(--white); font-size: 32px; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.8); font-size: 16px; margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- Testimonials --- */
.testimonial-card {
  background: var(--white); padding: 30px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); transition: var(--transition);
  border-left: 4px solid var(--gold);
}
.testimonial-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.testimonial-text { font-style: italic; color: var(--gray); margin-bottom: 16px; font-size: 15px; }
.testimonial-author { font-weight: 600; color: var(--dark); font-size: 14px; }
.testimonial-stars { color: var(--gold); margin-bottom: 12px; }

/* --- Contact Section --- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 40px; max-width: 600px; margin: 0 auto; }
.contact-info-card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px; background: var(--cream); border-radius: var(--radius);
  transition: var(--transition); margin-bottom: 16px;
}
.contact-info-card:hover { background: var(--white); box-shadow: var(--shadow); }
.contact-icon {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--white); border-radius: 50%;
  font-size: 20px; flex-shrink: 0;
}
.contact-info-card h4 { font-family: var(--font-body); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.contact-info-card p { font-size: 14px; color: var(--gray); margin: 0; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select {
  padding: 12px 16px; border: 1px solid var(--gray-lighter);
  border-radius: var(--radius); font-family: var(--font-body);
  font-size: 14px; transition: var(--transition); background: var(--white);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(210,174,109,0.15);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 16px 0; margin-top: 74px; background: var(--off-white);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.breadcrumb-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breadcrumb-list li a { color: var(--gray); }
.breadcrumb-list li a:hover { color: var(--gold); }
.breadcrumb-list li.active { color: var(--gold); font-weight: 500; }
.breadcrumb-sep { color: var(--gray-light); }

/* --- Page Hero --- */
.page-hero {
  position: relative; padding: 100px 0 60px; margin-top: 74px;
  background-size: cover; background-position: center;
  text-align: center; overflow: hidden;
}
.breadcrumb + .page-hero {
  margin-top: 0;
}
.page-hero::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(26,26,26,0.88) 0%, rgba(26,26,26,0.6) 100%);
}
.page-hero-content { position: relative; z-index: 2; }
.page-hero h1 { color: var(--white); font-size: 42px; margin-bottom: 12px; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 16px; max-width: 600px; margin: 0 auto; }

/* --- Footer --- */
.footer {
  background: #622f10; color: rgba(255,255,255,0.7); padding: 60px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { color: var(--white); font-family: var(--font-body); font-size: 16px; margin-bottom: 20px; font-weight: 600; }
.footer p { font-size: 14px; line-height: 1.8; }
.footer-links li { margin-bottom: 10px; }
.footer-links li a { color: rgba(255,255,255,0.7); font-size: 14px; transition: var(--transition); }
.footer-links li a:hover { color: var(--gold); padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border-radius: 50%; color: var(--white);
  transition: var(--transition);
}
.footer-social a:hover { background: var(--gold); transform: translateY(-2px); }

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background: var(--dark); color: var(--white); padding: 20px;
  z-index: 9999; transform: translateY(100%); transition: var(--transition);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-inner {
  max-width: 1200px; margin: 0 auto; display: flex;
  align-items: center; justify-content: space-between; gap: 20px;
}
.cookie-inner p { font-size: 14px; margin: 0; flex: 1; }
.cookie-inner a { color: var(--gold); text-decoration: underline; }
.cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.cookie-accept { background: var(--gold); color: var(--white); }
.cookie-accept:hover { background: var(--gold-dark); }
.cookie-reject { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.3); }
.cookie-reject:hover { border-color: var(--white); }

/* --- WhatsApp Float --- */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 998;
  width: 56px; height: 56px; background: #25d366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 28px; box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: var(--transition); animation: pulse 2s infinite;
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,0.5); color: var(--white); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.4); }
  50% { box-shadow: 0 4px 24px rgba(37,211,102,0.6); }
}

/* --- Scroll Animations --- */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in-left.visible { opacity: 1; transform: translateX(0); }
.fade-in-right { opacity: 0; transform: translateX(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in-right.visible { opacity: 1; transform: translateX(0); }
.scale-in { opacity: 0; transform: scale(0.9); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.scale-in.visible { opacity: 1; transform: scale(1); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Gallery --- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-item {
  border-radius: var(--radius); overflow: hidden; position: relative;
  cursor: pointer; aspect-ratio: 4/3;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(210,174,109,0.3); opacity: 0; transition: var(--transition);
}
.gallery-item:hover::after { opacity: 1; }

/* --- Map --- */
.map-container { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.map-container iframe { width: 100%; height: 400px; border: 0; }

/* --- 404 Page --- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.error-code { font-family: var(--font-heading); font-size: 120px; color: var(--gold); line-height: 1; }
.error-page h2 { font-size: 28px; margin: 20px 0 12px; }
.error-page p { color: var(--gray); margin-bottom: 30px; }

/* --- Legal Pages --- */
.legal-content { max-width: 800px; margin: 0 auto; }
.legal-content h2 { margin-top: 30px; }
.legal-content p, .legal-content li { color: var(--gray); font-size: 15px; line-height: 1.8; margin-bottom: 12px; }
.legal-content ul { padding-left: 20px; list-style: disc; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 768px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .nav-desktop { display: none; }
  .menu-toggle { display: flex; }
  .nav-mobile { display: block; }
  .hero { min-height: 80vh; }
  .hero-content h1 { font-size: 32px; }
  .hero-content p { font-size: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .cookie-inner { flex-direction: column; text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero h1 { font-size: 30px; }
  .section { padding: 50px 0; }
  .about-stats { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 480px) {
  .hero-content { padding: 20px; }
  .hero-content h1 { font-size: 26px; }
  .btn { padding: 12px 24px; font-size: 13px; }
  .gallery-grid { grid-template-columns: 1fr; }
}
