/* product_details.css - Styles specific to the individual product detail page */
/* Renamed from product.css for better clarity and naming consistency */

/* ========================================= */
/* BASE LAYOUT */
/* ========================================= */

/* HTML/body styles are handled by shared-styles.css */

/* Brand badge styling */
.brand-badge {
  background: var(--yellow);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e9c23c;
}

/* ========================================= */
/* NAVIGATION */
/* ========================================= */

/* Back button styling */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 24px;
}

.back-btn:hover {
  background: #f8f8f8;
}

/* ========================================= */
/* PRODUCT LAYOUT */
/* ========================================= */

/* Main product layout - two column grid */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin: 24px 0;
}

/* Product image container */
.product-image-container {
  width: 100%;
  max-width: 500px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  position: relative;
}

/* ========================================= */
/* IMAGE NAVIGATION (Product Image Carousel) */
/* ========================================= */

.image-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,27,46,0.08);
  transition: background .15s ease, transform .15s ease;
  z-index: 5;
}

.image-nav-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.03);
}

.image-nav-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.image-nav-btn--prev { left: -18px; }
.image-nav-btn--next { right: -18px; }

.image-nav-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ========================================= */
/* PRODUCT INFO SECTION */
/* ========================================= */

/* Product title */
.product-info h1 {
  font-size: 32px;
  margin: 0 0 8px;
  line-height: 1.1;
}

/* Product price */
.product-price {
  font-size: 22px; /* 35% smaller than 28px */
  font-weight: 700;
  color: var(--ink); /* Changed from blue to black */
  margin: 8px 0 16px;
}

/* Product tagline */
.product-tagline {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 20px;
  font-style: italic;
}

/* Specific spacing control between hat name and product type line */
#product-name {
  margin: 0 0 8px;
  line-height: 1.1;
}

/* ========================================= */
/* BADGES AND TAGS */
/* ========================================= */

/* Badge container */
.badges {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

/* Individual tag styling */
.tag {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

/* ========================================= */
/* BUTTON GROUPS */
/* ========================================= */

/* Button group layout */
.button-group {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

/* ========================================= */
/* PRODUCT DETAILS SECTIONS */
/* ========================================= */

/* Details section styling */
.details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.details h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.details ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.details li {
  margin: 8px 0;
}

/* ========================================= */
/* LOADING ANIMATION */
/* ========================================= */

/* Loading container for product page */
.loading-container {
  text-align: center;
  padding: 60px 20px;
}

/* Loading animation matching site design */
.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 30px 0;
}

/* Hat spinner animation */
.hat-spinner { 
  animation: hat-spin 2s linear infinite; 
}

.spinner-logo { 
  width: 80px; 
  height: 80px; 
  display: block; 
}

/* Loading dots animation */
.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  font-size: 20px;
  color: var(--blue);
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

/* Loading text styling */
.loading-text {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
}

/* Keyframe animations */
@keyframes hat-spin { 
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); } 
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================= */
/* RESPONSIVE LAYOUT */
/* ========================================= */

/* ========================================= */
/* COLOR SELECTOR (Product Options)          */
/* ========================================= */

.product-option {
  margin: 16px 0 8px;
}

.product-option-label {
  font-weight: 600;
  margin-bottom: 8px;
}

.color-selector {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}

.color-swatch.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,27,46,0.12);
}

.color-swatch--white {
  background: #fff;
}

.color-swatch--black {
  background: #111;
}

/* New split color swatches */
.color-swatch--natural-navy {
  background-image: linear-gradient(135deg, #E9E4D0 50%, #001F3F 50%); /* natural (khaki-ish) / navy */
}

.color-swatch--white-royal {
  background-image: linear-gradient(135deg, #FFFFFF 50%, #1E40AF 50%); /* white / royal blue (darker) */
}

/* .color-swatch--white-maroon {
  background-image: linear-gradient(135deg, #FFFFFF 50%, #800000 50%); 
} */

.color-swatch--red {
  background: #DC143C; /* crimson red */
}

/* Mobile layout - single column */
@media (max-width: 768px) {
  .product {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Mobile button group - stack vertically */
@media (max-width: 480px) {
  .button-group {
    flex-direction: column;
  }
  
  .button-group .btn {
    justify-self: stretch;
  }
}
