/* ===== Base ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #faf6f7;
  color: #222;
  line-height: 1.6;
}
h1,h2,h3 {
  font-family: 'Playfair Display', serif;
  margin: .4em 0;
}
a { color: #b11e2d; text-decoration: none; transition: .2s; }
a:hover { text-decoration: underline; }
.muted { color: #666; }

/* ===== Header ===== */
.site-header {
  background: #b11e2d;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header .brand {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
}
.site-header nav a {
  color: #fff;
  margin-left: 16px;
  font-weight: 600;
}
.site-footer {
  text-align: center;
  padding: 20px;
  color: #777;
  font-size: 14px;
  border-top: 1px solid #eee;
  margin-top: 40px;
}

/* ===== Container & Panel ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  margin-bottom: 20px;
}

/* ===== Button ===== */
.btn {
  background: #b11e2d;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: .25s;
}
.btn:hover { background: #941122; }
.btn.secondary { background: #444; }
.btn.secondary:hover { background: #222; }
.btn-sm {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #b11e2d;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* ===== Catalog (index.html) ===== */
.template-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 20px;
  margin-top: 20px;
}
.tpl-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tpl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.tpl-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.tpl-info {
  padding: 12px;
  text-align: center;
}
.tpl-info h3 {
  margin: 0;
  font-size: 18px;
  color: #b11e2d;
}
.tpl-info p {
  margin: 4px 0 0;
  color: #444;
  font-weight: 600;
}

/* ===== Builder (admin.html) ===== */
.builder-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}
.preview-panel iframe {
  width: 100%;
  height: 560px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
}
@media(max-width:900px){
  .builder-grid { grid-template-columns: 1fr; }
  .preview-panel iframe { height: 500px; }
}
.two-col { display: flex; gap: 12px; }
.two-col label { flex: 1; }

.thumbs {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(90px,1fr));
  gap:10px;
  margin:10px 0;
}
.thumbs img {
  width:100%;
  height:80px;
  object-fit:cover;
  border-radius:8px;
  border:2px solid #eee;
}
.thumbs button {
  position:absolute;
  top:4px; right:4px;
  background:rgba(0,0,0,.6);
  color:#fff;
  border:none;
  border-radius:4px;
  font-size:11px;
  padding:2px 4px;
  cursor:pointer;
}

/* QR bank box */
.bank-box {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #f0b6bd;
  border-radius: 12px;
  background: #fff7f8;
}
.bank-box img {
  width: 180px;
  height: 180px;
  border-radius: 10px;
}

/* ===== Invitation (invitation.html) ===== */
.invite-root {
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px 20px;
  background: linear-gradient(135deg,#fff5f7,#fdeff2);
}
.invite-card {
  max-width: 800px;
  background:#fff;
  border: 4px solid #d4af37;
  border-radius:24px;
  overflow:hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  text-align:center;
  position:relative;
}
.invite-cover {
  width:100%;
  height:340px;
  object-fit:cover;
  border-bottom: 3px solid #d4af37;
}
.cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.invite-subtitle {
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}
.invite-names {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  margin: 8px 0 0;
  color: #fceabb;
  text-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
.invite-body { padding:30px 20px; }
.invite-body h2 { font-size: 20px; margin-bottom: 12px; color: #b11e2d; }
.invite-body p { margin: 6px 0; font-size: 16px; }
.invite-note {
  margin: 20px auto;
  font-style: italic;
  color: #444;
  max-width: 500px;
}
.invite-footer {
  padding: 15px;
  background: #faf6f7;
  font-size: 14px;
  color: #777;
}

/* Countdown tròn */
.countdown {
  display:flex;
  gap:15px;
  justify-content:center;
  margin:30px 0;
}
.countdown div {
  background:#fff;
  border:2px solid #d4af37;
  border-radius:50%;
  width:80px; height:80px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  font-size:14px;
  color:#b11e2d;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  animation:pulse 2s infinite;
}
.countdown b {
  display:block;
  font-size:22px;
  color:#222;
}
@keyframes pulse {
  0%{ transform:scale(1); }
  50%{ transform:scale(1.05); }
  100%{ transform:scale(1); }
}

/* ===== Album effects ===== */
.album-fade {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:10px;
}
.album-fade img {
  height:130px;
  border-radius:12px;
  opacity:0;
  transform:translateY(8px);
  animation:fadeInUp .6s forwards;
}
@keyframes fadeInUp { to{opacity:1; transform:none;} }

.album-tilt {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:12px;
}
.album-tilt img {
  height:120px;
  border-radius:10px;
  transform:rotate(-2deg);
  box-shadow:0 6px 16px rgba(180,26,87,.12);
}
.album-tilt img:nth-child(even){ transform:rotate(2deg); }

.album-zoom {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.album-zoom img {
  height:140px;
  border-radius:12px;
  transition:transform .3s;
}
.album-zoom img:hover { transform:scale(1.05); }

.album-carousel { position:relative; overflow:hidden; }
.album-carousel .slides { display:flex; transition:transform .6s ease; }
.album-carousel .slide { flex:0 0 100%; }
.album-carousel img {
  width:100%;
  height:360px;
  object-fit:cover;
  border-radius:16px;
}
.album-carousel .nav {
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  background:rgba(0,0,0,.5);
  color:#fff;
  border:none;
  border-radius:50%;
  width:40px;
  height:40px;
  cursor:pointer;
}
.album-carousel .prev { left:10px; }
.album-carousel .next { right:10px; }

.album-kenburns { display:grid; gap:12px; }
.album-kenburns img {
  width:100%;
  height:280px;
  border-radius:16px;
  animation:kenburns 12s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform:scale(1) translate(0,0); }
  to   { transform:scale(1.1) translate(-3%,-3%); }
}

/* ===== Share page ===== */
.share-wrap {
  max-width:720px;
  margin:32px auto;
  background:#fff;
  border-radius:16px;
  padding:24px;
  box-shadow:0 14px 40px rgba(0,0,0,.08);
}
.linkbox { display:flex; gap:8px; }
.linkbox input {
  flex:1;
  padding:10px;
  border:1px solid #ddd;
  border-radius:10px;
}
/* Hero */
.hero { position: relative; }
.hero-img { width: 100%; height: 420px; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
}
.names {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  color: #fceabb;
  text-shadow: 0 3px 6px rgba(0,0,0,.5);
}
.subtitle { font-size: 20px; color: #fff; }

/* Details */
.details {
  padding: 20px;
  background: #fff;
  border-bottom: 2px solid #d4af37;
}
.details h2 { margin: 0 0 12px; color: #b11e2d; }

/* Countdown */
.countdown {
  display:flex; gap:15px; justify-content:center;
  margin:20px 0; flex-wrap:wrap;
}
.countdown div {
  background:#fff;
  border:2px solid #d4af37;
  border-radius:50%;
  width:80px; height:80px;
  display:flex; flex-direction:column;
  justify-content:center; align-items:center;
  font-size:14px; color:#b11e2d;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  animation:pulse 2s infinite;
}
.countdown b { font-size:22px; color:#222; }
@keyframes pulse {
  0%{ transform:scale(1); }
  50%{ transform:scale(1.05); }
  100%{ transform:scale(1); }
}

/* Album carousel */
.album-carousel { position:relative; overflow:hidden; margin:20px auto; max-width:800px; }
.album-carousel .slides { display:flex; transition:transform .6s ease; }
.album-carousel .slide { flex:0 0 100%; }
.album-carousel img { width:100%; height:400px; object-fit:cover; border-radius:12px; }
.album-carousel .nav {
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(0,0,0,.5); color:#fff;
  border:none; border-radius:50%;
  width:40px; height:40px; cursor:pointer;
}
.album-carousel .prev { left:10px; }
.album-carousel .next { right:10px; }

/* RSVP */
.rsvp { padding:20px; background:#fff7f8; margin:20px; border-radius:12px; }
.rsvp h3 { margin-top:0; color:#b11e2d; }
.rsvp form { display:flex; flex-direction:column; gap:10px; }
.rsvp input, .rsvp select, .rsvp textarea {
  padding:10px; border:1px solid #ddd; border-radius:8px;
}
.rsvp button { align-self:flex-start; }

/* Footer */
.invite-footer {
  text-align:center; padding:15px; background:#faf6f7;
  font-size:14px; color:#777;
}
