/**
 * Additional styles — WooCommerce refinements, responsive
 *
 * @package IMD_Theme
 */

/* =============================================
   CLOCK DIAL CANVAS
============================================= */
#clockCanvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* =============================================
   HEADER — Always black, no transparent override
============================================= */

/* =============================================
   SMOOTH SCROLL OFFSET
============================================= */
[id] {
  scroll-margin-top: 80px;
}

/* =============================================
   WOOCOMMERCE LOOP OVERRIDE — use our grid
============================================= */
.woocommerce ul.products.columns-3,
.woocommerce ul.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.25em !important;
}

@media (max-width: 1023px) {
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 639px) {
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4 {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================
   WOOCOMMERCE: Cart & Checkout Tweaks
============================================= */
.woocommerce-cart .page-hero,
.woocommerce-checkout .page-hero,
.woocommerce-account .page-hero {
  min-height: 200px;
}

/* Remove default WooCommerce result count & ordering when not needed */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
  margin-bottom: 1.5rem !important;
}

.woocommerce .woocommerce-ordering select {
  border: 1px solid var(--color-border);
  border-radius: 30px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
}

/* =============================================
   WOOCOMMERCE: Notices styling
============================================= */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error li {
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

/* =============================================
   WOOCOMMERCE: Mini cart widget
============================================= */
.widget_shopping_cart .total {
  font-family: var(--font-body);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

/* =============================================
   POST NAVIGATION
============================================= */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1;
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation a {
  font-family: var(--font-display);
  font-size: 1rem;
  transition: color 0.3s ease;
}

.post-navigation a:hover {
  color: var(--color-accent);
}

/* =============================================
   WORDPRESS CLASSES
============================================= */
.wp-block-image img {
  max-width: 100%;
  height: auto;
}

.aligncenter { text-align: center; }
.alignleft { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }

.wp-caption { max-width: 100%; }

.wp-caption-text {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin-top: 0.5rem;
  text-align: center;
}

/* =============================================
   CONTACT PAGE — Responsive grid
============================================= */
@media (max-width: 767px) {
  .page-content > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================
   FORM STYLES
============================================= */
.contact-form .form-group {
  margin-bottom: 1.25rem;
}

.contact-form label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(141, 114, 91, 0.1);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* =============================================
   RESPONSIVE REFINEMENTS
============================================= */
@media (max-width: 767px) {
  .products-grid {
    grid-template-columns: 1fr !important;
  }

  .product-card__image {
    height: 280px;
  }

  .post-card__image {
    height: 250px;
  }

  .post-navigation {
    flex-direction: column;
  }

  .post-navigation .nav-next {
    text-align: left;
  }

  /* WooCommerce single product mobile layout */
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary {
    width: 100% !important;
    float: none !important;
  }
}

/* =============================================
   HERO VIDEO CAROUSEL (front page, bottom-left, near the nav menu)
   Width matches logo image width (logo aspect ratio ≈ 0.864 = 600/694)
============================================= */
.hero-video {
  position: absolute;
  left: 32px;
  bottom: 56px;
  width: min(345px, 26vw, 39vh);
  z-index: 18;
  font-family: var(--font-body, sans-serif);
}

@media (max-width: 1500px) {
  .hero-video {
    left: 28px;
    bottom: 52px;
    width: min(295px, 23vw, 37vh);
  }
}

@media (max-width: 1280px) {
  .hero-video {
    left: 24px;
    bottom: 48px;
    width: min(248px, 21vw, 35vh);
  }
}

/* Small label header above the carousel */
.hero-video__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--color-accent, #8d725b);
}

.hero-video__rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(141,114,91,0.55), transparent);
}

.hero-video__label {
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #3a2c20;
}

/* Stage (clips slides) */
.hero-video__stage {
  position: relative;
}

.hero-video__viewport {
  overflow: hidden;
  border-radius: 4px;
}

.hero-video__track {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0.02, 0.2, 1);
  will-change: transform;
}

.hero-video__slide {
  flex: 0 0 100%;
  min-width: 0;
}

/* Gold ornate frame */
.hero-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0907;
  border: 1px solid rgba(141,114,91,0.7);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 5px var(--color-bg-warm, #fbf6f1),
    inset 0 0 0 6px rgba(141,114,91,0.55),
    0 12px 22px -10px rgba(60,40,20,0.35);
  overflow: hidden;
}

/* Inner gold hairline */
.hero-video__frame-deco {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(180,155,120,0.45);
  pointer-events: none;
  z-index: 3;
}

/* Decorative L-shaped corner flourishes */
.hero-video__corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(180,155,120,0.75);
  z-index: 4;
  pointer-events: none;
}
.hero-video__corner--tl { top: 6px;    left: 6px;    border-right: none; border-bottom: none; }
.hero-video__corner--tr { top: 6px;    right: 6px;   border-left:  none; border-bottom: none; }
.hero-video__corner--bl { bottom: 6px; left: 6px;    border-right: none; border-top:    none; }
.hero-video__corner--br { bottom: 6px; right: 6px;   border-left:  none; border-top:    none; }

.hero-video__play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  overflow: hidden;
}

.hero-video__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.hero-video__play:hover .hero-video__thumb {
  transform: scale(1.04);
}

.hero-video__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.32));
  pointer-events: none;
}

.hero-video__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(251,246,241,0.94);
  color: var(--color-accent, #8d725b);
  border: 1px solid rgba(141,114,91,0.55);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  box-sizing: border-box;
}
.hero-video__play-icon svg {
  display: block;
}

.hero-video__play:hover .hero-video__play-icon {
  transform: scale(1.08);
  background: var(--color-accent, #8d725b);
  color: var(--color-bg-warm, #fbf6f1);
}

.hero-video__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 4;
}

.hero-video__caption {
  display: none;
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: 0.85rem;
  color: #4a3a2a;
  letter-spacing: 0.03em;
}
.hero-video__caption.is-active {
  display: block;
}

/* Controls (prev | dots | next) under the frame */
.hero-video__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.hero-video__nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(251,246,241,0.85);
  border: 1px solid rgba(141,114,91,0.5);
  color: var(--color-accent, #8d725b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.hero-video__nav:hover {
  background: var(--color-accent, #8d725b);
  color: var(--color-bg-warm, #fbf6f1);
  transform: scale(1.08);
}

.hero-video__dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-video__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(141,114,91,0.55);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.hero-video__dot.is-active {
  background: var(--color-accent, #8d725b);
  transform: scale(1.25);
}

/* Tablet & below: video drops into the centered column flow under the dial */
@media (max-width: 1024px) {
  .hero-video {
    position: static;
    transform: none;
    width: min(420px, 90%);
    margin: 16px auto 0;
  }
}

@media (max-width: 768px) {
  .hero-video {
    width: min(360px, 92%);
    margin-top: 12px;
  }
  .hero-video__play-icon {
    width: 48px; height: 48px; margin: -24px 0 0 -24px;
  }
  .hero-video__play-icon svg { width: 26px; height: 26px; }
}

@media (max-width: 480px) {
  .hero-video {
    width: 92%;
    margin-top: 10px;
  }
  .hero-video__label {
    font-size: 0.78rem;
  }
}

/* =============================================
   PRINT
============================================= */
@media print {
  .site-header, .site-footer, .mobile-menu,
  .hero-clock, .hero, .filter-tabs, .country-nav,
  .product-card__actions, .woocommerce-pagination,
  .hero-video {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
}
