/* ==============================
   Melisa Crandlemire Fine Art
   Master Stylesheet
   ============================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #FAFAFA;
  color: #2D2D2D;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-weight: 400;
  color: #1A1A1A;
}

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

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

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

/* --- Navigation --- */
.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E8E8E8;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.logo a {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: #1A1A1A;
}

.logo a:hover {
  color: #8B7355;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 0.875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555;
  transition: color 0.2s ease;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: #8B7355;
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #8B7355;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.cart-count.visible {
  opacity: 1;
  transform: scale(1);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
  padding: 4px;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.hero p {
  font-size: 1rem;
  color: #777;
  line-height: 1.7;
}

/* --- Page Header --- */
.page-header {
  text-align: center;
  padding: 48px 24px 32px;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-header p {
  color: #777;
  font-size: 0.95rem;
}

/* --- Collection Filter --- */
.collection-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 24px 32px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: system-ui, -apple-system, sans-serif;
  background: none;
  border: 1px solid #D0D0D0;
  padding: 8px 20px;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  color: #555;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: #8B7355;
  color: #8B7355;
}

.filter-btn.active {
  background: #8B7355;
  border-color: #8B7355;
  color: #fff;
}

/* --- Artwork Grid --- */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 0 24px 64px;
  max-width: 1280px;
  margin: 0 auto;
}

.artwork-card {
  background: #fff;
  border: 1px solid #EDEDED;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.artwork-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.artwork-card .card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.artwork-card .card-link:hover .card-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.artwork-card .card-link:hover .image-wrapper img {
  transform: scale(1.03);
}

.artwork-card .image-wrapper {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f5f5f5;
}

.artwork-card .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  position: relative;
  z-index: 2;
}

.artwork-card .image-wrapper img.loaded {
  z-index: 2;
}

.artwork-card:hover .image-wrapper img {
  transform: scale(1.03);
}

.artwork-card .image-wrapper .skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  pointer-events: none;
}

.artwork-card .image-wrapper img.loaded ~ .skeleton-overlay {
  display: none;
}

.artwork-card .card-body {
  padding: 16px 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.artwork-card .card-title {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1rem;
  font-weight: 400;
  color: #1A1A1A;
  margin-bottom: 4px;
  line-height: 1.3;
}

.artwork-card .card-artist {
  font-size: 0.8rem;
  color: #8B7355;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.artwork-card .card-details {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 8px;
}

.artwork-card .card-price {
  font-size: 1rem;
  font-weight: 500;
  color: #1A1A1A;
  margin-bottom: 12px;
  margin-top: auto;
}

.add-to-cart-btn {
  width: 100%;
  padding: 10px 0;
  background: #1A1A1A;
  color: #fff;
  border: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}

.add-to-cart-btn:hover {
  background: #8B7355;
}

.add-to-cart-btn.added {
  background: #5a7a5a;
}

/* --- About Page --- */
.about-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.about-content {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: flex-start;
}

.about-photo {
  flex: 0 0 280px;
}

.artist-photo {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.about-content .bio {
  flex: 1;
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
}

.about-content .bio p {
  margin-bottom: 16px;
}

.about-content .artist-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 32px;
  background: #fff;
  border: 1px solid #EDEDED;
}

.about-content .detail-item h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8B7355;
  margin-bottom: 4px;
}

.about-content .detail-item p {
  font-size: 0.95rem;
  color: #444;
}

/* --- Cart Page --- */
.cart-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.cart-empty {
  text-align: center;
  padding: 64px 24px;
}

.cart-empty p {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 24px;
}

.cart-empty .continue-shopping {
  display: inline-block;
  padding: 12px 32px;
  background: #1A1A1A;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.2s ease;
}

.cart-empty .continue-shopping:hover {
  background: #8B7355;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #EDEDED;
}

.cart-item:first-child {
  border-top: 1px solid #EDEDED;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.cart-item-info h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.cart-item-info .cart-item-medium {
  font-size: 0.8rem;
  color: #888;
}

.cart-item-info .cart-item-price {
  font-size: 0.9rem;
  color: #1A1A1A;
  margin-top: 4px;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid #D0D0D0;
}

.quantity-selector button {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  color: #555;
  transition: background 0.2s ease;
}

.quantity-selector button:hover {
  background: #f0f0f0;
}

.quantity-selector span {
  width: 36px;
  text-align: center;
  font-size: 0.9rem;
}

.remove-item {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #999;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.remove-item:hover {
  color: #c0392b;
}

.cart-item-subtotal {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1A1A1A;
}

/* --- Cart Product Options --- */
.cart-item-options {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cart-option-label {
  font-size: 0.72rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.cart-option-label input[type="checkbox"] {
  accent-color: #8B7355;
}

/* --- Order Summary --- */
.cart-summary {
  background: #fff;
  border: 1px solid #EDEDED;
  padding: 28px 32px;
  max-width: 400px;
  margin-left: auto;
}

.cart-summary h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EDEDED;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 6px 0;
  color: #555;
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1A1A1A;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #EDEDED;
}

.checkout-btn {
  width: 100%;
  padding: 14px 0;
  background: #1A1A1A;
  color: #fff;
  border: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s ease;
}

.checkout-btn:hover {
  background: #8B7355;
}

.checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1A1A1A;
  color: #fff;
  padding: 14px 24px;
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Footer --- */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid #E8E8E8;
  padding: 32px 24px;
  margin-top: auto;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: #999;
  letter-spacing: 0.3px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.8rem;
  color: #777;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #8B7355;
}

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

@media (max-width: 768px) {
  .header-inner {
    padding: 14px 20px;
  }

  .logo a {
    font-size: 1.05rem;
  }

  .main-nav {
    gap: 20px;
  }

  .main-nav a {
    font-size: 0.78rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .about-content .artist-details {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .about-content {
    flex-direction: column;
  }

  .about-photo {
    flex: none;
    max-width: 280px;
    margin: 0 auto;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 600px) {
  .artwork-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px 48px;
  }

  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 16px 32px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid #E8E8E8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

  .main-nav.open {
    display: flex;
  }

  .cart-summary {
    max-width: 100%;
    padding: 24px;
  }
}

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