/* ==================================================
   TITAN IRON WORKS - GALLERY PAGE STYLES
   Custom Ornamental Iron Doors - Gallery Page
   ================================================== */

:root {
  --color-primary: #1a1a1a;
  --color-secondary: #2d2d2d;
  --color-accent: #8b7355;
  --color-accent-light: #a89070;
  --color-accent-dark: #6b5640;
  --color-white: #ffffff;
  --color-off-white: #f5f5f3;
  --color-gray-light: #e5e5e5;
  --color-gray: #888888;
  --color-text: #333333;
  --color-text-light: #666666;

  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  --container-max: 1400px;
  --container-padding: 1.25rem;
  --header-height: 70px;
}

/* ==================================================
   BASE & RESET
   ================================================== */

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

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

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ==================================================
   UTILITY CLASSES
   ================================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================
   TYPOGRAPHY
   ================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-primary);
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

/* ==================================================
   BUTTONS
   ================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

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

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

.btn-outline-light:hover {
  background-color: var(--color-white);
  color: var(--color-primary);
}

/* ==================================================
   HEADER
   ================================================== */

.header {
  position: fixed;
  top: 40px; /* Dev banner height */
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-primary);
  transition: all var(--transition-base);
}

.header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__logo-img {
  height: 45px;
  width: auto;
}

.nav {
  display: none;
}

.nav__list {
  display: flex;
  gap: var(--space-lg);
}

.nav__link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  position: relative;
  padding: 0.5rem 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent-light);
  transition: width var(--transition-base);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header__cta {
  display: none;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  z-index: 1001;
}

.menu-toggle__bar {
  width: 100%;
  height: 2px;
  background-color: var(--color-white);
  transition: all var(--transition-fast);
  border-radius: 1px;
}

.menu-toggle.active .menu-toggle__bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .menu-toggle__bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ==================================================
   MOBILE NAVIGATION
   ================================================== */

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-primary);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: right var(--transition-slow);
  padding-top: 40px; /* Dev banner height */
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.mobile-nav__link {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-white);
  transition: color var(--transition-fast);
  letter-spacing: 0.1em;
}

.mobile-nav__link:hover {
  color: var(--color-accent-light);
}

.mobile-nav__contact {
  margin-top: var(--space-2xl);
  text-align: center;
}

.mobile-nav__phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-accent-light);
  margin-bottom: var(--space-md);
}

.mobile-nav__socials {
  display: flex;
  gap: var(--space-md);
}

.mobile-nav__social {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--color-white);
  transition: all var(--transition-fast);
}

.mobile-nav__social:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ==================================================
   PAGE HERO
   ================================================== */

.page-hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-3xl) + 40px) 0 var(--space-3xl); /* +40px for dev banner */
  background-color: var(--color-primary);
  text-align: center;
  overflow: hidden;
}

.page-hero__background {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.page-hero__background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 26, 26, 0.5) 0%, rgba(26, 26, 26, 0.9) 100%);
}

.page-hero__content {
  position: relative;
  z-index: 2;
}

.page-hero__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.15em;
}

.page-hero__subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--color-gray-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.page-hero__breadcrumb {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-gray);
}

.page-hero__breadcrumb a {
  color: var(--color-accent-light);
}

.page-hero__breadcrumb a:hover {
  color: var(--color-white);
}

.page-hero__breadcrumb span {
  color: var(--color-gray);
}

/* ==================================================
   GALLERY SECTION
   ================================================== */

.gallery-page {
  padding: var(--space-3xl) 0;
  background-color: var(--color-off-white);
}

/* Filter Tabs */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Gallery Grid */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.gallery-item {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-white);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.8) 0%, rgba(26, 26, 26, 0) 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-white);
  margin-bottom: 0.25rem;
}

.gallery-item__category {
  font-size: 0.7rem;
  color: var(--color-accent-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gallery-item__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  color: var(--color-primary);
  opacity: 0;
  transition: all var(--transition-base);
}

.gallery-item:hover .gallery-item__zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==================================================
   CTA SECTION
   ================================================== */

.cta-section {
  padding: var(--space-3xl) 0;
  background-color: var(--color-primary);
  text-align: center;
}

.cta-section__title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.1em;
}

.cta-section__text {
  color: var(--color-gray);
  margin-bottom: var(--space-lg);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

/* ==================================================
   LIGHTBOX
   ================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.lightbox__close:hover {
  color: var(--color-accent-light);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox__nav:hover {
  background-color: var(--color-accent);
}

.lightbox__nav--prev {
  left: -60px;
}

.lightbox__nav--next {
  right: -60px;
}

.lightbox__counter {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-gray);
  font-size: 0.85rem;
}

/* ==================================================
   FOOTER
   ================================================== */

.footer {
  background-color: var(--color-primary);
  padding: var(--space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer__logo {
  height: 50px;
  width: auto;
  margin-bottom: var(--space-xs);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
}

.footer__nav-link {
  font-size: 0.8rem;
  color: var(--color-gray);
  transition: color var(--transition-fast);
  letter-spacing: 0.05em;
}

.footer__nav-link:hover {
  color: var(--color-accent-light);
}

.footer__copyright {
  font-size: 0.8rem;
  color: var(--color-gray);
}

/* ==================================================
   WHATSAPP FLOAT
   ================================================== */

.whatsapp-float {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 999;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #25d366;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-fast);
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: var(--color-white);
}

/* ==================================================
   ANIMATIONS
   ================================================== */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: all 0.7s ease;
}

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

/* ==================================================
   SCROLL TO TOP BUTTON
   ================================================== */

.scroll-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 998;
  box-shadow: 0 4px 15px rgba(139, 115, 85, 0.4);
  border: none;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(139, 115, 85, 0.5);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
}

/* ==================================================
   IMPROVED DEV BANNER
   ================================================== */

.dev-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  color: var(--color-white);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 40px;
  border-bottom: 2px solid var(--color-accent);
}

.dev-banner__icon {
  font-size: 1.25rem;
  animation: pulse-warning 2s ease-in-out infinite;
}

.dev-banner__text {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: linear-gradient(90deg, #ff6b35, #ffa07a, #ff6b35);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.dev-banner__badge {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-white);
  box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { 
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  50% { 
    transform: rotate(180deg) scale(1.1);
    opacity: 0.8;
  }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes badge-glow {
  0%, 100% { 
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 2px 20px rgba(255, 107, 53, 0.6);
    transform: scale(1.05);
  }
}

/* Responsive for dev banner */
@media (max-width: 600px) {
  .dev-banner {
    flex-wrap: wrap;
    height: auto;
    min-height: 40px;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .dev-banner__text {
    order: 1;
    width: 100%;
    font-size: 0.65rem;
  }
  
  .dev-banner__icon,
  .dev-banner__badge {
    order: 2;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dev-banner__icon,
  .dev-banner__text,
  .dev-banner__badge {
    animation: none !important;
  }
}

/* ==================================================
   RESPONSIVE - TABLET
   ================================================== */

@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
    --header-height: 80px;
  }

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

  .lightbox__nav--prev {
    left: -70px;
  }

  .lightbox__nav--next {
    right: -70px;
  }
}

/* ==================================================
   RESPONSIVE - DESKTOP
   ================================================== */

@media (min-width: 1024px) {
  :root {
    --header-height: 90px;
  }

  .menu-toggle {
    display: none;
  }

  .nav {
    display: block;
  }

  .header__cta {
    display: inline-flex;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
  }
}

@media (min-width: 1400px) {
  :root {
    --container-padding: 3rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ==================================================
   PREFERS REDUCED MOTION
   ================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
