* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background-w: hsl(42, 47%, 97%);
  --foreground: hsl(240, 10%, 12%);
  --card: hsl(0, 0%, 100%);
  --primary: hsl(240, 8%, 18%);
  --primary-foreground: hsl(42, 47%, 97%);
  --secondary: hsl(42, 35%, 90%);
  --muted: hsl(42, 25%, 94%);
  --muted-foreground: hsl(240, 5%, 45%);
  --accent: hsl(38, 75%, 55%);
  --accent-foreground: hsl(0, 0%, 100%);
  --border: hsl(42, 20%, 88%);

  --gold: hsl(38, 75%, 55%);
  --gold-light: hsl(38, 70%, 70%);
  --charcoal: hsl(240, 8%, 18%);
  --cream: hsl(42, 47%, 97%);

  --hero-height: 680px;
  --section-bg: #fbf7f3; /* the color of the section below (adjust to match) */
  --hero-tint: rgba(12, 14, 20, 0.28); /* optional tint to darken image */

  --navbar-height: 0px;
}

body {
  font-family: "Rubik Distressed", system-ui;
  background-color: var(--background-w);
  color: var(--foreground);
  line-height: 2;
  font-size: 1.25rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  /* Corrected backdrop-filter: blur() uses pixels, not percent */
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  /* Added transitions for smooth resizing */
  transition: padding 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding 0.3s ease;
}

/* .nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
} */

.nav-logo {
  display: flex;
  align-items: center;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  gap: 0.5rem;
  transition: padding 0.3s ease;
}

.logo-img {
  height: 4.5rem; /* Increase height (try 3rem or larger) */
  width: auto; /* Maintain aspect ratio */
  display: inline-block;
  transition: background 0.3s, box-shadow 0.3s, height 0.3s ease;
}

.logo-img:hover {
  background: var(--accent);
}

.small-txt-menu {
  color: var(--accent);
  transition: color 0.3s, font-size 0.3s ease, opacity 0.3s ease;
  font-weight: 200;
}

.small-txt-menu:hover {
  color: var(--gold-light);
  cursor: pointer;
}

.cart-button {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--foreground);
  transition: color 0.3s ease;
}

.cart-button:hover {
  color: var(--accent);
}

/* Added transition for cart icon scaling */
.cart-button svg {
  width: 24px;
  height: 24px;
  transition: width 0.3s ease, height 0.3s ease;
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.3s ease; /* Transition for position/size */
}

/* For Tablets */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }

  .nav-container {
    padding: 0 1rem;
    justify-content: space-between; /* Ensure proper spacing */
  }

  .logo-img {
    height: 3.5rem;
  }

  .nav-logo {
    font-size: 1.25rem;
  }

  .small-txt-menu {
    font-size: 0.9rem;
  }
}

/* For Mobile Phones */
@media (max-width: 600px) {
  .navbar {
    padding: 0.5rem 0; /* Reduce padding further */
  }

  .nav-container {
    padding: 0 1rem;
    justify-content: space-between; /* Force proper distribution */
    gap: 1rem; /* Add gap for better spacing */
  }

  .logo-img {
    height: 3rem;
  }

  .nav-logo {
    font-size: 1.15rem;
    flex-shrink: 0; /* Prevent logo from shrinking too much */
  }

  .cart-button {
    flex-shrink: 0; /* Prevent cart button from shrinking */
    margin-left: auto; /* Push cart to the right */
    padding: 0.375rem; /* Slightly smaller padding */
  }

  .cart-button svg {
    width: 20px; /* Smaller icon */
    height: 20px;
  }

  .cart-count {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    top: 2px;
    right: 2px;
    min-width: 16px; /* Ensure count badge has minimum size */
    text-align: center;
  }
}

/* For very narrow phones */
@media (max-width: 360px) {
  .nav-container {
    padding: 0 0.75rem;
    gap: 0.5rem; /* Reduce gap on very small screens */
    justify-content: space-between;
  }

  .logo-img {
    height: 2.75rem;
  }

  .cart-button {
    padding: 0.25rem;
  }

  .cart-button svg {
    width: 18px;
    height: 18px;
  }

  .cart-count {
    font-size: 0.6rem;
    padding: 0.05rem 0.25rem;
    min-width: 14px;
  }
}

/* Extra insurance for cart button visibility */
@media (max-width: 600px) {
  .nav-container {
    /* Ensure the cart button is always visible and properly positioned */
    position: relative;
    justify-content: space-between;
  }

  .cart-button {
    position: static; /* Reset any positioning that might cause issues */
    opacity: 1 !important; /* Force visibility */
    visibility: visible !important;
  }
}

/* Hero */
.hero {
  margin-top: 105px;
  min-height: 1000px;
  /* background-image: url("/images/hero-artwork.jpg"); */
  background-image: url("/images/piktura/2.png");
  background-position: center;
  /* background-size: calc(100%); */
  background-size: cover;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;

  /* Added transitions for smooth responsive scaling */
  transition: min-height 0.3s ease, margin-top 0.3s ease, padding 0.3s ease;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0; /* cover entire hero */
  pointer-events: none;
  z-index: 2;

  /* two-layer gradient:
     - top: optional tint to darken the image slightly
     - bottom: fade to the section color so the hero visually blends into the next section */
  /* background-image: */
    /* linear-gradient(to bottom, var(--hero-tint) 3%, rgba(12,14,20,0) 90%), */ 
    /* linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 70%,
      var(--muted) 95%
    ),
    linear-gradient(to top, rgba(255, 255, 255, 0) 50%, var(--background-w) 97%); */

  /* make the blending smoother */
  background-blend-mode: normal;
}

/* Put hero content above overlay */
.hero > * {
  position: relative;
  z-index: 3;
}

/* Next section must have the same background color for the seamless effect */

.hero-content {
  max-width: 800px;
  color: white;
  animation: fadeInUp 1s ease-out;
}

.hero-title {
  font-family: "Kranky", system-ui;
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  transition: font-size 0.3s ease;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 500;
  opacity: 0.95;
  transition: font-size 0.3s ease;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  transition: flex-direction 0.3s ease;
}

/* Buttons */
.btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.25rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: white;
  font-weight: 100;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: var(--charcoal);
}

.btn-full {
  width: 100%;
}

/* =================================== */
/* ==      RESPONSIVE STYLES      == */
/* =================================== */

/* For Tablets */
@media (max-width: 768px) {
  .navbar a {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .small-txt-menu {
    font-size: 0.95rem;
  }

  .hero {
    /* Adjust margin-top to match tablet navbar height */
    /* (3.5rem logo + 0.75rem padding * 2) = 80px */
    margin-top: 80px;
    min-height: 800px; /* Reduce height */
    padding: 3rem 1.5rem; /* Reduce top/bottom padding */
  }

  .hero-title {
    font-size: 3rem; /* Reduce font size */
  }

  .hero-description {
    font-size: 1.15rem; /* Reduce font size */
  }

  
}

/* For Mobile Phones */
@media (max-width: 600px) {
  .hero {
    /* Adjust margin-top to match mobile navbar height */
    /* (3rem logo + 0.75rem padding * 2) = 72px */
    margin-top: 72px;
    min-height: 700px; /* Further reduce height */
    padding: 3rem 1rem; /* Reduce side padding */
  }

  .hero-title {
    font-size: 2.5rem; /* Smaller font size */
  }

  .hero-description {
    font-size: 1rem; /* Standard mobile font size */
    margin-bottom: 2.5rem; /* More space for stacked buttons */
  }

  .hero-buttons {
    flex-direction: column; /* Stack buttons vertically */
    align-items: center; /* Center stacked buttons */
    gap: 0.75rem; /* Reduce gap for stacked buttons */
  }

  .hero-buttons .btn {
    width: 100%; /* Make buttons full-width... */
    max-width: 350px; /* ...up to a max width for readability */
  }

  .small-txt-menu {
    font-size: 0.9rem;
  }
}

/* For very narrow phones */
@media (max-width: 360px) {
  .hero {
    /* Adjust margin-top for smallest navbar */
    /* (2.75rem logo + 0.75rem padding * 2) = 68px */
    margin-top: 68px;
    min-height: 650px; /* Smallest height */
  }

  .hero-title {
    font-size: 2.15rem; /* Smallest title font size */
  }

  .btn {
    /* Slightly smaller buttons */
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .small-txt-menu {
    font-size: 0.9rem;
  }
}

/* Collection Section */
.collection-section {
  padding: 5rem 1.5rem;
  margin-top: 0 !important; /* neutralize any previous fixed pixel offset */
  /* add safe-area inset for iOS and measured navbar height */
  padding-top: calc(var(--navbar-height, 0px) + env(safe-area-inset-top, 0px));
}

@media (max-width: 768px) {
  .collection-section {
    padding: 0;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 0.6s ease-out;
}

.section-title {
  font-family: "Kranky", serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.section-description {
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.125rem;
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Artwork Card */
.artwork-card {
  background: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: scaleIn 0.4s ease-out backwards;
  cursor: pointer;
  outline: none;
}

.artwork-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.25);
}

.artwork-card:focus {
  box-shadow: 0 0 0 4px rgba(168, 192, 255, 0.25);
  transform: translateY(-2px);
}

.artwork-image {
  width: 100%;
  height: 440px;
  object-fit: cover;
  cursor: pointer;
}

.artwork-info {
  padding: 1.5rem;
}

.artwork-header {
  margin-bottom: 1rem;
}

.artwork-title {
  font-family: "Kranky", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.artwork-artist {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.artwork-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--secondary);
  color: var(--foreground);
  font-size: 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.artwork-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.artwork-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.artwork-price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  font-family: "Kranky", serif;
}

.btn-add-cart {
  padding: 0.625rem 1.25rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: "Rubik Distressed", system-ui;
  font-weight: 100;
}

.btn-add-cart:hover {
  background: var(--charcoal);
  opacity: 0.9;
}

/* Carousel Section */
/* .carousel-section {
  padding: 5rem 1.5rem;
} */

/* Footer */
.footer {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 1rem 1.5rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-title {
  font-family: "Kranky", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-description {
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.footer-copyright {
  font-family: ui-monospace;
  font-size: 1.2rem;
  opacity: 0.6;
}

.footer-link{
  color: var(--accent-foreground);
  font-weight: 900;
  text-decoration: underline;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
}

.modal.active {
  display: block;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border-radius: 0.5rem;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--foreground);
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.modal-close:hover {
  background: var(--muted);
}

.modal-body {
  padding: 2rem;
}

.modal-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.modal-details {
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-artist {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.modal-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.modal-description {
  color: var(--muted-foreground);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Cart Sheet */
.cart-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
}

.cart-sheet.active {
  display: block;
}

.cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.cart-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 450px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease-out;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
}

.cart-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--foreground);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-artist {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 600;
  color: var(--accent);
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
}

.cart-item-remove:hover {
  color: var(--foreground);
}

.cart-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted-foreground);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease-out;
  min-width: 300px;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Responsive */
/* @media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .artwork-grid {
    grid-template-columns: 1fr;
  }

  .cart-content {
    max-width: 100%;
  }
} */


.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-links a svg {
  /* fill: rgba(255, 255, 255, 0.8); */
  stroke: var(--cream);
}

.social-links a:hover {
  background: var(--accent);
}
