* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Varela", sans-serif;
  background-color: #fafafa;
  color: #333;
  line-height: 1.6;
}

/* Header styles */
header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.logo {
  font-size: 1.5rem;
  color: #000; /* black for main text */
}

.logo .ia {
  color: oklch(41.17% 0.157 16.58); /* lighter grey for 'ia' */
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: #333;
}

nav a:hover {
  color: #666;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-icon {
    width: 20px;
    height: 20px;
}

/* Gallery styles */
.gallery {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Loading animation styles */
.gallery-item {
  position: relative;
  background: #f0f0f0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  height: 100%;
  width: 100%;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border: 2px solid #ddd;
  border-top-color: #999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: loading 0.8s linear infinite;
  z-index: 5;
  margin: 0;
  display: block;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  display: block;
}

.gallery-item img.loaded {
  opacity: 1;
}


/* Update overlay styles */
.overlay {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 3;
}

.gallery-item:hover .overlay {
  bottom: 0;
  opacity: 1;
}

.overlay-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  max-width: 70%;
  margin-right: 12px;
}

.overlay-price {
  font-size: 15px; /* Match title size */
  font-weight: 500;
  color: white; /* Changed from accent color */
  padding: 0;
  background: none;
  border-radius: 0;
  white-space: nowrap;
}

@keyframes loading {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Footer styles */
footer {
  padding: 2rem;
  border-top: 1px solid #eee;
  margin-top: 2rem;
}

footer nav ul {
  justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    padding: 1rem;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  footer nav ul {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.modal-overlay.closing {
  opacity: 0;
}

/* Modal Layout */
.modal-content {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  max-width: 1560px; /* 1200px * 1.3 = 1560px */
  width: 90vw;
  min-height: 910px; /* 700px * 1.3 = 910px */
  max-height: 90vh;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  align-items: start;
}

.image-container {
  position: relative;
  background: transparent;
  border-radius: 0;
  min-height: 910px; /* 700px * 1.3 = 910px */
  max-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

.modal-image {
  max-width: 100%;
  max-height: 910px; /* 700px * 1.3 = 910px */
  object-fit: contain;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.modal-image.loaded {
  opacity: 1;
  display: block;
}

.info-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #333;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.5rem 0.5rem 0.5rem 0;
}

.modal-column.image-container {
  overflow: hidden;
  min-height: 910px; /* 700px * 1.3 = 910px */
  max-height: calc(85vh - 4rem);
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #666;
  margin-bottom: 1.5rem;
}

.print-options {
  background-color: #f5f5f5;
  padding: 1.25rem;
  border-radius: 8px;
  margin-top: 0;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.print-options h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #444;
  font-weight: 600;
  position: relative;
  padding-left: 0.5rem;
  border-left: 3px solid oklch(41.17% 0.157 16.58);
}

.size-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.size-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  line-height: 1.2;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.size-option:hover {
  background: #f8f8f8;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Hide the default checkbox */
.size-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom checkbox */
.size-option .checkbox-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.size-option .checkmark {
  position: relative;
  display: inline-block;
  height: 18px;
  width: 18px;
  margin-right: 8px;
  border: 2px solid #ddd;
  border-radius: 3px;
  background-color: #fff;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Style the checkbox when hovered */
.size-option:hover .checkmark {
  border-color: oklch(41.17% 0.157 16.58);
}

/* Style the checked checkbox */
.size-option input[type="checkbox"]:checked ~ .checkmark {
  background-color: oklch(41.17% 0.157 16.58);
  border-color: oklch(41.17% 0.157 16.58);
}

/* Create the checkmark (hidden when not checked) */
.size-option .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Show the checkmark when checked */
.size-option input[type="checkbox"]:checked ~ .checkmark:after {
  display: block;
}

/* Extra indicator for checked state to ensure visual feedback works */
.size-option input[type="checkbox"]:checked ~ .checkbox-container .checkmark {
  background-color: oklch(41.17% 0.157 16.58);
  border-color: oklch(41.17% 0.157 16.58);
}

.size-option input[type="checkbox"]:checked ~ span {
  font-weight: 600;
  color: oklch(41.17% 0.157 16.58);
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .modal-content {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .image-container {
    max-height: 50vh;
    min-height: auto;
    padding: 0;
    margin-bottom: 1rem;
  }
  
  .modal-column.image-container {
    min-height: auto;
  }
  
  .info-sidebar {
    max-height: none;
    padding: 0 1rem;
  }

  .size-list {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .modal-image {
    max-height: 50vh;
  }
}

@media (max-width: 768px) {
  .modal-content {
    padding: 1rem;
    gap: 1rem;
  }
  
  .image-container {
    padding: 0;
    min-height: 250px;
    position: relative;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .spinner {
    z-index: 5;
    opacity: 1;
    visibility: visible;
  }

  .size-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-overlay {
    padding: 0.5rem;
  }
  
  .modal-close {
    top: 15px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .image-container {
    max-height: 40vh;
    padding: 0;
    position: relative;
    min-height: 200px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  
  .spinner {
    z-index: 5;
    width: 30px;
    height: 30px;
    opacity: 1;
    visibility: visible;
    border-width: 3px;
  }
  
  .info-sidebar {
    padding: 0 0.5rem;
  }

  .size-list {
    grid-template-columns: 1fr;
  }
  
  .modal-title {
    font-size: 1.2rem;
  }
  
  .print-options {
    padding: 1rem;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.8rem;
  }
}
