/* ============================================
   ALQUIMIA - Orfebrería Mística
   Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lato:wght@300;400;700&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #5a7d7c;
  --bg-dark: #4a6a69;
  --bg-darker: #3d5a59;
  --card-bg: #f5f0d0;
  --card-bg-light: #faf6e6;
  --gold: #c9a84c;
  --gold-dark: #a8893d;
  --gold-light: #e0c96e;
  --text-dark: #2c2c2c;
  --text-cream: #f5f0d0;
  --text-gold: #d4b85c;
  --white: #ffffff;
  --shadow: rgba(0,0,0,0.3);
  --border-gold: #b8983a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-cream);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* ---- Header ---- */
.header {
  position: relative;
  background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-primary) 100%);
  padding: 20px 0;
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.logo-tree {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 2px;
}

.logo-circle h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 16px;
  color: var(--gold-light);
  text-align: center;
  line-height: 1.1;
}

.logo-circle .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 10px;
  color: var(--text-cream);
  text-align: center;
}

.contact-banner {
  background: var(--gold);
  color: var(--text-dark);
  padding: 12px 25px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
  box-shadow: 0 3px 10px var(--shadow);
}

.contact-banner a {
  color: var(--text-dark);
}

.location {
  width: 100%;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--gold-light);
  margin-top: 5px;
}

/* ---- Hero / About Section ---- */
.hero {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-artist {
  text-align: center;
}

.about-artist h2 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 32px;
  color: var(--gold-light);
  margin-bottom: 15px;
}

.about-artist p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-cream);
  opacity: 0.9;
}

.orfebreria-info {
  text-align: center;
}

.orfebreria-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 28px;
  color: var(--gold-light);
  margin-bottom: 20px;
}

.orfebreria-title::before,
.orfebreria-title::after {
  content: '✦';
  margin: 0 10px;
  font-size: 14px;
  vertical-align: middle;
}

.materials-info {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 25px;
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.materials-info .col {
  margin-bottom: 15px;
}

.materials-info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--gold-light);
}

.materials-info p {
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.9;
}

.divider-ornament {
  text-align: center;
  margin: 10px 0;
  color: var(--gold);
  font-size: 20px;
  letter-spacing: 8px;
}

/* ---- Catalog Section ---- */
.catalog-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.section-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 34px;
  text-align: center;
  color: var(--gold-light);
  margin-bottom: 35px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 100px;
  height: 3px;
  background: var(--gold);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ---- Product Grid ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.product-card .image-wrapper {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1a1a1a;
}

.product-card .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .image-wrapper img {
  transform: scale(1.05);
}

.product-card .card-info {
  padding: 12px 15px;
  color: var(--text-dark);
}

.product-card .card-info h3 {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.product-card .card-info .desc {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  line-height: 1.4;
  color: #555;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-info .material {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.product-card .card-info .code {
  font-size: 11px;
  color: #777;
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-darker);
  margin-top: 50px;
  padding: 30px 20px;
  text-align: center;
  border-top: 3px solid var(--gold);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--text-dark);
  font-size: 22px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.15);
  background: var(--gold-light);
}

.footer-credit {
  font-size: 12px;
  color: var(--text-cream);
  opacity: 0.7;
  margin-top: 10px;
  font-style: italic;
}

/* ---- Product Detail Page ---- */
.product-detail {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 20px;
}

.product-detail-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow);
}

.product-detail-card .detail-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail-card .detail-image img {
  max-width: 80%;
  max-height: 90%;
  object-fit: contain;
}

.product-detail-card .detail-info {
  padding: 30px 35px;
  text-align: center;
  color: var(--text-dark);
}

.product-detail-card .detail-info h2 {
  font-family: 'Lato', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 15px;
}

.product-detail-card .detail-info .desc {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 20px;
}

.product-detail-card .detail-info .material {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-detail-card .detail-info .code {
  font-size: 16px;
  color: #666;
}

.btn-back {
  display: inline-block;
  margin-top: 25px;
  padding: 12px 30px;
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 700;
  border-radius: 25px;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-back:hover {
  background: var(--gold-light);
}

.detail-contact {
  margin-top: 20px;
  padding: 15px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-contact a {
  color: var(--gold-light);
}

/* ---- Cart Icon (floating) ---- */
.cart-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--text-dark);
  box-shadow: 0 4px 15px var(--shadow);
  cursor: pointer;
  transition: transform 0.3s;
  z-index: 1000;
  border: none;
}

.cart-float:hover {
  transform: scale(1.1);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #c0392b;
  color: white;
  font-size: 12px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Cart Sidebar ---- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card-bg);
  color: var(--text-dark);
  z-index: 1002;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 20px var(--shadow);
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 20px;
  background: var(--bg-darker);
  color: var(--text-cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h3 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 18px;
}

.cart-close {
  background: none;
  border: none;
  color: var(--text-cream);
  font-size: 24px;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
  align-items: center;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-size: 14px;
  margin-bottom: 3px;
}

.cart-item-info p {
  font-size: 12px;
  color: #666;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 18px;
  cursor: pointer;
}

.cart-footer {
  padding: 20px;
  border-top: 2px solid var(--gold);
}

.cart-footer .btn-whatsapp {
  display: block;
  width: 100%;
  padding: 14px;
  background: #25d366;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.3s;
}

.cart-footer .btn-whatsapp:hover {
  background: #1da851;
}

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-style: italic;
}

/* ---- Admin Styles ---- */
.admin-header {
  background: var(--bg-darker);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}

.admin-header h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 22px;
  color: var(--gold-light);
}

.admin-header .admin-nav {
  display: flex;
  gap: 15px;
}

.admin-header .admin-nav a {
  color: var(--text-cream);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background 0.3s;
}

.admin-header .admin-nav a:hover {
  background: rgba(255,255,255,0.1);
}

.admin-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-toolbar h2 {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--gold-light);
  font-size: 24px;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-gold {
  background: var(--gold);
  color: var(--text-dark);
}

.btn-gold:hover {
  background: var(--gold-light);
}

.btn-danger {
  background: #c0392b;
  color: white;
}

.btn-danger:hover {
  background: #e74c3c;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* Admin Product Table */
.admin-table-wrapper {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--bg-darker);
  color: var(--gold-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 16px;
  text-align: left;
}

.admin-table td {
  padding: 12px 16px;
  color: var(--text-dark);
  font-size: 14px;
  border-bottom: 1px solid #e0dcc0;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(201, 168, 76, 0.08);
}

.admin-table .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

/* Admin Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: 12px;
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px var(--shadow);
}

.modal-header {
  background: var(--bg-darker);
  padding: 18px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--gold-light);
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-cream);
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 25px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #d4cfb0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Lato', sans-serif;
  background: var(--card-bg-light);
  color: var(--text-dark);
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  padding: 15px 25px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #d4cfb0;
}

.image-preview {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
  border: 2px solid #d4cfb0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .logo-circle {
    width: 100px;
    height: 100px;
  }

  .logo-circle h1 {
    font-size: 13px;
  }

  .section-title {
    font-size: 26px;
  }

  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card .card-info {
    padding: 8px 10px;
  }

  .product-card .card-info h3 {
    font-size: 12px;
  }

  .product-card .card-info .desc {
    font-size: 11px;
  }

  .social-icons a {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Admin login */
.admin-login {
  max-width: 400px;
  margin: 80px auto;
  padding: 0 20px;
}

.admin-login-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px 30px;
  box-shadow: 0 8px 30px var(--shadow);
  text-align: center;
  color: var(--text-dark);
}

.admin-login-card h2 {
  font-family: 'Cinzel Decorative', cursive;
  color: var(--bg-darker);
  margin-bottom: 25px;
  font-size: 22px;
}

.admin-login-card .form-group {
  text-align: left;
}

.admin-login-card .btn {
  width: 100%;
  margin-top: 10px;
}

.alert {
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 13px;
}

.alert-error {
  background: #fce4e4;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Nav link to admin */
.admin-link {
  position: fixed;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.3);
  color: var(--text-cream);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 999;
  transition: background 0.3s;
}

.admin-link:hover {
  background: rgba(0,0,0,0.5);
}

/* Add to cart button on detail page */
.btn-add-cart {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 30px;
  background: var(--bg-primary);
  color: var(--white);
  font-weight: 700;
  border-radius: 25px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-add-cart:hover {
  background: var(--bg-dark);
}
