:root {
  --primary: #4285F4;
  --primary-hover: #3367d6;
  --secondary: #f8f9fa;
  --accent: #0F9D58;
  --accent-light: #e6f4ea;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --border-radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-family: 'Google Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.catalog-header {
  text-align: center;
  margin-bottom: 40px;
}

.catalog-header h1 {
  font-size: 2.8em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #4285F4 0%, #3367d6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.catalog-header p {
  font-size: 1.2em;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
}

.value-prop {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 40px 0;
}

.value-item {
  display: flex;
  align-items: center;
  background: white;
  padding: 15px 25px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 300px;
}

.value-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  margin-right: 15px;
  font-size: 1.5em;
  font-weight: bold;
}

.value-text {
  font-size: 1em;
  color: var(--text-secondary);
}

.value-text strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--secondary);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.filter-btn {
  background-color: var(--secondary);
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  text-transform: capitalize;
}

.filter-btn:hover {
  background-color: #e8eaed;
}

.filter-btn.active {
  background-color: var(--primary);
  color: white;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.template-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.template-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.template-image {
  height: 220px;
  overflow: hidden;
  position: relative;
}

.template-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.template-card:hover .template-image img {
  transform: scale(1.05);
}

.template-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-card:hover .template-overlay {
  opacity: 1;
}

.preview-btn {
  background-color: white;
  color: var(--text-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}

.preview-btn:hover {
  background-color: var(--primary);
  color: white;
}

.template-details {
  padding: 20px;
}

.template-title {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.template-description {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 15px;
  height: 60px;
  overflow: hidden;
}

.template-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.template-price {
  font-weight: 700;
  font-size: 1.3em;
  color: var(--accent);
}

.buy-btn {
  background-color: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.buy-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

.new-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--accent);
  color: white;
  font-size: 0.75em;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  z-index: 2;
}

.popular-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--primary);
  color: white;
  font-size: 0.75em;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  z-index: 2;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  width: 80%;
  max-width: 900px;
  border-radius: var(--border-radius);
  position: relative;
}

.close-modal {
  color: var(--text-secondary);
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text-primary);
}

.preview-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.preview-image {
  margin: 0 auto;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-details {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.preview-info {
  flex: 1;
  min-width: 300px;
}

.preview-title {
  font-size: 1.8em;
  margin-bottom: 15px;
}

.preview-desc {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.preview-features {
  margin-top: 20px;
}

.preview-feature {
  margin: 10px 0;
  padding-left: 25px;
  position: relative;
}

.preview-feature:before {
  content: "?";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.preview-purchase {
  flex: 0 0 300px;
  background-color: var(--secondary);
  padding: 20px;
  border-radius: var(--border-radius);
}

.preview-price {
  font-size: 2em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}

.preview-buy-btn {
  display: block;
  width: 100%;
  background-color: var(--primary);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1em;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 15px;
  transition: var(--transition);
}

.preview-buy-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

.how-it-works {
  margin: 60px 0;
  text-align: center;
}

.how-it-works h2 {
  font-size: 2em;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.step {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 25px 15px;
  width: 250px;
  text-align: center;
}

.step-number {
  background: var(--primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 20px;
}

.step h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.faq-section {
  margin: 60px 0;
}

.faq-section h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.faq-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px 25px;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-question {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 1.1em;
}

.faq-answer {
  color: var(--text-secondary);
}

.footer {
  text-align: center;
  margin-top: 60px;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin: 40px 0;
}

.error-message h3 {
  color: #d93025;
  margin-bottom: 10px;
}

.error-message p {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .catalog-header h1 {
    font-size: 2.2em;
  }
  
  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .template-image {
    height: 180px;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  .preview-details {
    flex-direction: column;
  }
  
  .preview-purchase {
    flex: 1;
  }
  
  .value-prop {
    flex-direction: column;
    align-items: center;
  }
  
  .steps {
    flex-direction: column;
    align-items: center;
  }
}





/* Carousel Styles */
.image-carousel {
  position: relative;
  margin-bottom: 20px;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f5;
  user-select: none;
}

.carousel-container.zoom-mode {
  cursor: grab;
  overflow: hidden;
}

.carousel-container.zoom-mode:active {
  cursor: grabbing;
}

.carousel-container:hover .carousel-indicator {
  display: block;
  opacity: 0.8;
}


.preview-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: none;
  border-radius: 8px;
}

.preview-image.active {
  display: block;
}

.preview-image.zoomed {
  cursor: grab;
  transform: scale(2.5);
  z-index: 10;
  position: relative;
  transition: none;
}

.preview-image.zoomed:active {
  cursor: grabbing;
}

.carousel-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background-color: var(--secondary);
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.tab-btn:hover {
  background-color: #e8eaed;
}

.tab-btn.active {
  background-color: var(--primary);
  color: white;
}

/* Auto-cycle indicator */
.carousel-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12px;
  display: none;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.carousel-indicator.show {
  display: block;
  opacity: 1;
}