:root {
  --primary: #6B4C9A;
  --secondary: #4E327A;
  --accent: #A78BCC;
  --primary-light: #A78BCC;
  --secondary-pink: #E3A8B7;
  --secondary-rose: #C47A8A;
  --secondary-sage: #AFC9C2;
  --secondary-sage-dark: #7FA59A;
  --bg-light: #F6F1F3;
  --bg-white: #FFFFFF;
  --neutral-light: #DCD6DD;
  --neutral-dark: #4A4A4A;
  --text-dark: #4A4A4A;
  --text-muted: #6B7280;
  --border-light: #DCD6DD;
  --card-bg: #FFFFFF;
  --success: #25D366;
  --gradient-primary: linear-gradient(135deg, #6B4C9A 0%, #A78BCC 100%);
  --gradient-secondary: linear-gradient(135deg, #E3A8B7 0%, #C47A8A 100%);
  --gradient-sage: linear-gradient(135deg, #AFC9C2 0%, #7FA59A 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #F6F1F3 0%, #FFFFFF 100%);
  /* background-attachment: fixed removido: quebra em iOS Safari */
  color: var(--text-dark);
  line-height: 1.6;
}

/* Header/Navbar */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: var(--gradient-primary);
  box-shadow: 0 4px 20px rgba(107, 76, 154, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.top h1 {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  background: linear-gradient(135deg, #FFFFFF, #E0E7FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.admin-link {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 35px 40px;
  background: var(--gradient-primary);
  color: white;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  animation: heroFadeIn 1s ease-out;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero h2 {
  font-size: 38px;
  font-weight: 700;
  font-family: 'Parisienne', cursive;
  margin-bottom: 16px;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
  position: relative;
  animation: titlePulse 2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero-icon {
  height: 42px;
  width: auto;
  vertical-align: middle;
  filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.2));
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes titlePulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.02);
    text-shadow: 2px 4px 12px rgba(255, 255, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.3);
  }
}

.hero p {
  font-size: 17px;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 300;
  position: relative;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin: 50px 0 80px 0;
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(107, 76, 154, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(107, 76, 154, 0.08);
  animation: fadeInUp 0.6s ease-out backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.card:hover {
  transform: translateY(-12px);
  box-shadow: 0 16px 40px rgba(107, 76, 154, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  z-index: 10;
}

.media {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #F6F1F3, #E8DFF0);
  position: relative;
}

.media::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s;
}

.card:hover .media::after {
  left: 100%;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .media img {
  transform: scale(1.08);
}

.placeholder {
  color: #999;
  font-size: 14px;
  text-align: center;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card h3 {
  font-size: 19px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.4;
  letter-spacing: -0.3px;
  transition: color 0.3s ease;
}

.card:hover h3 {
  color: var(--primary);
}

.price {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 12px 0;
  letter-spacing: -0.5px;
}

.price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 8px;
}

.stock {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stock-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--secondary-sage), var(--secondary-sage-dark));
  color: white;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(107, 76, 154, 0.2);
}

.desc {
  flex: 1;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.7;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--success) 0%, #1fa952 100%);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-whatsapp::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-whatsapp:hover::before {
  width: 300px;
  height: 300px;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #1fa952 0%, #158841 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px 20px;
  background: var(--gradient-primary);
  color: white;
  font-size: 13px;
  box-shadow: 0 -4px 20px rgba(107, 76, 154, 0.2);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
  background-blend-mode: overlay;
}

.footer p {
  margin: 0;
  opacity: 0.9;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* Admin Styles */
.form {
  max-width: 500px;
  margin: 40px auto;
  background: var(--card-bg);
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form h2 {
  color: var(--primary);
  margin-bottom: 24px;
  font-size: 28px;
  font-family: 'Playfair Display', serif;
}

.form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-family: inherit;
  transition: all 0.3s ease;
  font-size: 15px;
  background: #FAFAFA;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(107, 76, 154, 0.1);
}

.form button {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(107, 76, 154, 0.3);
  font-size: 15px;
}

.form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(107, 76, 154, 0.5);
}

.form button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(107, 76, 154, 0.3);
}

/* Table */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

table thead {
  background: var(--gradient-primary);
  color: white;
}

table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

table a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

table a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

table a:hover {
  color: var(--secondary);
}

table a:hover::after {
  width: 100%;
}

/* WhatsApp Flutuante */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 70px;
  z-index: 1000;
  background: linear-gradient(135deg, #25D366 0%, #1fa952 100%);
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 64px;
  height: 64px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
  }
}

.whatsapp-float:hover,
.whatsapp-float:focus {
  transform: scale(1.15);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 30px 20px;
  }

  .hero h2 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .top {
    padding: 12px 16px;
  }
  
  .top h1 {
    font-size: 22px;
    gap: 6px;
  }

  .header-icon {
    height: 28px;
  }

  table th,
  table td {
    padding: 10px 10px;
    font-size: 13px;
  }

  .form {
    margin: 20px auto;
    padding: 20px 16px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 24px 16px;
  }
  
  .hero h2 {
    font-size: 28px;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-content {
    padding: 14px;
  }

  .price {
    font-size: 22px;
  }

  .btn-whatsapp {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .whatsapp-float {
    right: 12px;
    bottom: 72px;
    width: 52px;
    height: 52px;
  }
  
  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }

  /* Admin: botão salvar ocupa linha própria */
  .settings-form {
    flex-direction: column;
  }

  .settings-form input {
    min-width: 0;
    width: 100%;
  }

  .settings-form button {
    width: 100%;
  }
}

/* Borboletas Decorativas */
.butterfly {
  position: fixed;
  width: 80px;
  height: 80px;
  opacity: 0.7;
  z-index: 100;
  filter: drop-shadow(0 2px 8px rgba(107, 76, 154, 0.3));
  pointer-events: none;
  will-change: transform;
}

.butterfly-1 {
  top: 70%;
  left: 5%;
  animation: flutter-path-1 25s ease-in-out infinite;
}

.butterfly-2 {
  top: 30%;
  right: 8%;
  animation: flutter-path-2 30s ease-in-out infinite;
}

@keyframes flutter-path-1 {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  10% {
    transform: translate(100px, -50px) rotate(10deg) scale(1.05);
  }
  20% {
    transform: translate(200px, -30px) rotate(-5deg) scale(1);
  }
  30% {
    transform: translate(250px, 40px) rotate(15deg) scale(0.95);
  }
  40% {
    transform: translate(200px, 100px) rotate(-10deg) scale(1.1);
  }
  50% {
    transform: translate(100px, 80px) rotate(5deg) scale(1);
  }
  60% {
    transform: translate(50px, 20px) rotate(-15deg) scale(0.9);
  }
  70% {
    transform: translate(150px, -20px) rotate(8deg) scale(1.05);
  }
  80% {
    transform: translate(80px, 60px) rotate(-8deg) scale(1);
  }
  90% {
    transform: translate(20px, 30px) rotate(12deg) scale(0.95);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@keyframes flutter-path-2 {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  12% {
    transform: translate(-80px, 60px) rotate(-12deg) scale(0.95);
  }
  24% {
    transform: translate(-150px, 30px) rotate(8deg) scale(1.08);
  }
  36% {
    transform: translate(-200px, -40px) rotate(-15deg) scale(1);
  }
  48% {
    transform: translate(-180px, -100px) rotate(10deg) scale(0.92);
  }
  60% {
    transform: translate(-100px, -80px) rotate(-8deg) scale(1.05);
  }
  72% {
    transform: translate(-50px, -20px) rotate(15deg) scale(1);
  }
  84% {
    transform: translate(-120px, 20px) rotate(-10deg) scale(0.98);
  }
  96% {
    transform: translate(-40px, 50px) rotate(5deg) scale(1.02);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@media (max-width: 768px) {
  .butterfly {
    width: 60px;
    height: 60px;
  }
  
  @keyframes flutter-path-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(80px, -30px) rotate(10deg); }
    50% { transform: translate(40px, 40px) rotate(-10deg); }
    75% { transform: translate(20px, -10px) rotate(5deg); }
  }
  
  @keyframes flutter-path-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-60px, 30px) rotate(-10deg); }
    50% { transform: translate(-30px, -30px) rotate(10deg); }
    75% { transform: translate(-15px, 10px) rotate(-5deg); }
  }
}
