/**
 * WooCommerce Single Product Custom Styles
 *
 * Desktop: Split layout with sticky content
 * Mobile/Tablet: Stacked layout with horizontal gallery
 */

/* ====================
   VARIATION BUTTONS (all screen sizes)
   ==================== */

.azur-product-summary .variations .value {
  position: relative;
  display: block;
}

/* Hide native select — replaced by custom buttons */
.azur-product-summary .variations select {
  display: none;
}

.azur-variation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.azur-variation-button {
  min-width: 60px;
  padding: 10px 16px;
  border: 2px solid #ddd;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  user-select: none;
}

.azur-variation-button:hover {
  border-color: #999;
  background: #f5f5f5;
}

.azur-variation-button.selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.azur-variation-button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.azur-product-summary .reset_variations {
  display: inline-block;
  font-size: 13px;
  color: #666;
  text-decoration: underline;
  margin-top: 10px;
  cursor: pointer;
}

.azur-product-summary .reset_variations:hover {
  color: #000;
}

/* ====================
   TABS (all screen sizes)
   ==================== */

.woocommerce-tabs .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  border-bottom: 1px solid #eee;
}

.woocommerce-tabs .tabs li {
  margin: 0;
}

.woocommerce-tabs .tabs li a {
  display: block;
  padding: 8px 15px;
  text-decoration: none;
  color: #666;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.3s ease;
}

.woocommerce-tabs .tabs li.active a,
.woocommerce-tabs .tabs li a:hover {
  color: #000;
  border-bottom-color: #000;
}

/* Hide redundant panel headings (WC outputs them as h2) */
.woocommerce-tabs .woocommerce-Tabs-panel h2 {
  display: none;
}

/* Add to Cart Button */
.azur-product-summary .single_add_to_cart_button {
  width: 100%;
  padding: 18px 30px;
  font-size: 18px;
  font-weight: 700;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  cursor: pointer;
  transition: 0.3s ease;
  margin-bottom: 20px;
}

.azur-product-summary .single_add_to_cart_button:hover {
  background: #000;
  color: #fff;
}

/* ====================
   DESKTOP LAYOUT (992px+)
   ==================== */
@media (min-width: 992px) {
  .azur-single-product-wrapper {
    max-width: 2020px;
    margin: 0 auto;
    padding: 40px 20px;
  }

  .azur-product-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
  }

  /* Left Column: Images (50%) */
  .azur-product-images {
    flex: 0 0 50%;
    position: relative;
  }

  /* Gallery Wrapper */
  .azur-product-gallery-wrapper {
    position: relative;
    display: flex;
  }

  /* Thumbnails — sticky scroll, visually overlaid via negative margin */
  .azur-gallery-thumbnails {
    flex: 0 0 80px;
    margin-right: -80px;
    position: sticky;
    top: 40px;
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
  }

  .azur-thumbnail-item {
    width: 80px;
    height: 80px;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    transition: border-color 0.3s ease;
  }

  .azur-thumbnail-item:hover,
  .azur-thumbnail-item.active {
    border-color: #000;
  }

  .azur-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Main Gallery Images (Vertical Stack) */
  .azur-gallery-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .azur-gallery-image {
    width: 100%;
  }

  .azur-gallery-image a {
    display: block;
    overflow: hidden;
  }

  .azur-gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
  }

  .azur-gallery-image a:hover img {
    transform: scale(1.05);
  }

  /* Right Column: Content (50%, Sticky) */
  .azur-product-content {
    flex: 0 0 50%;
    position: sticky;
    top: 40px;
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .azur-product-summary {
    padding: 20px;
    background: #fff;
  }

  /* Product Title */
  .azur-product-summary .product_title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
  }

  .azur-product-brand {
    margin: -2px 0 16px;
  }

  .azur-product-brand__link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    transition:
      border-color 0.2s ease,
      color 0.2s ease;
  }

  .azur-product-brand__link:hover {
    color: #444;
  }

  .azur-product-brand__logo {
    display: block;
    width: auto;
    height: 24px;
    max-width: min(180px, 45vw);
    object-fit: contain;
  }

  .azur-product-brand__name {
    display: inline-block;
  }

  /* Breadcrumbs */
  .azur-product-summary .woocommerce-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
  }

  .woocommerce-breadcrumb a {
    color: #666;
    text-decoration: none;
  }

  .woocommerce-breadcrumb a:hover {
    color: #000;
  }

  /* Price */
  .azur-product-summary .price {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin-bottom: 20px;
  }

  /* Short Description */
  .azur-product-summary .woocommerce-product-details__short-description {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
  }

  /* Variations */
  .azur-product-summary .variations {
    margin-bottom: 15px;
  }

  .azur-product-summary .variations .label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0;
    padding-right: 0;
  }

  /* Full Description */
  .woocommerce-product-details__full-description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
  }

  .woocommerce-product-details__full-description h1,
  .woocommerce-product-details__full-description h2,
  .woocommerce-product-details__full-description h3 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
  }

  .woocommerce-product-details__full-description p {
    margin-bottom: 12px;
  }

  .woocommerce-product-details__full-description ul,
  .woocommerce-product-details__full-description ol {
    margin-left: 20px;
    margin-bottom: 12px;
  }

  /* Tabs */
  .woocommerce-tabs {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
  }

  .woocommerce-tabs .tabs {
    gap: 20px;
  }

  .woocommerce-tabs .tabs li a {
    padding: 10px 20px;
    font-size: inherit;
  }

  .woocommerce-tabs .woocommerce-Tabs-panel {
    padding: 20px 0;
  }

  .woocommerce-tabs .woocommerce-Tabs-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 20px;
  }

  .woocommerce-tabs table {
    width: 100%;
    border-collapse: collapse;
  }

  .woocommerce-tabs table th,
  .woocommerce-tabs table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
  }

  .woocommerce-tabs table th {
    font-weight: 600;
    width: 40%;
  }

  .azurbrand-care-instructions p {
    line-height: 1.7;
    margin-bottom: 12px;
  }

  .azurbrand-care-instructions ul,
  .azurbrand-care-instructions ol {
    margin-left: 20px;
    margin-bottom: 12px;
    line-height: 1.7;
  }
}

/* ====================
   TABLET/MOBILE LAYOUT (< 992px)
   ==================== */
@media (max-width: 991px) {
  .azur-single-product-wrapper {
    padding: 20px 0;
  }

  .azur-product-container {
    display: flex;
    flex-direction: column;
  }

  /* Images Section */
  .azur-product-images {
    width: 100%;
    margin-bottom: 30px;
  }

  /* Gallery Wrapper - Horizontal Scroll */
  .azur-product-gallery-wrapper {
    position: relative;
    overflow: hidden;
  }

  /* Hide Thumbnails on Mobile/Tablet */
  .azur-gallery-thumbnails {
    display: none;
  }

  /* Main Gallery - Horizontal Layout */
  .azur-gallery-main {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .azur-gallery-main::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .azur-gallery-image {
    flex: 0 0 auto;
    height: 400px;
    scroll-snap-align: start;
  }

  .azur-gallery-image a {
    display: block;
    height: 100%;
  }

  .azur-gallery-image img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: cover;
  }

  /* Content Section */
  .azur-product-content {
    width: 100%;
    padding: 0 20px;
  }

  .azur-product-summary {
    padding: 0;
  }

  .azur-product-summary .product_title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
  }

  .azur-product-brand {
    margin: -2px 0 14px;
  }

  .azur-product-brand__link {
    font-size: 13px;
  }

  .azur-product-brand__logo {
    height: 22px;
    max-width: min(160px, 55vw);
  }

  .azur-product-summary .woocommerce-breadcrumb {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .azur-product-summary .variations .label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0;
    padding-right: 0;
  }

  .azur-product-summary .price {
    font-size: 22px;
    margin-bottom: 15px;
  }

  .azur-product-summary .woocommerce-product-details__short-description {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .azur-product-summary .single_add_to_cart_button {
    padding: 15px 25px;
    font-size: 16px;
  }

  .woocommerce-product-details__full-description {
    margin-top: 20px;
    padding-top: 20px;
  }

  .woocommerce-tabs {
    margin-top: 20px;
    padding-top: 20px;
  }

  .azur-product-summary .single_add_to_cart_button {
    width: 100%;
  }
}

/* Mobile Only (< 768px) */
@media (max-width: 767px) {
  .azur-gallery-image {
    height: 300px;
  }

  .azur-product-summary .product_title {
    font-size: 20px;
  }

  .azur-product-brand__link {
    font-size: 12px;
  }

  .azur-product-brand__logo {
    height: 20px;
    max-width: min(140px, 62vw);
  }

  .azur-product-summary .price {
    font-size: 20px;
  }
}

/* ====================
   RELATED / UPSELLS SECTIONS (all screens)
   ==================== */

.azur-related-section {
  max-width: 2020px;
  margin: 60px auto 0;
}

.azur-related-section__title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

@media (max-width: 991px) {
  .azur-related-section {
    margin-top: 40px;
    padding: 0 16px;
  }

  .azur-related-section__title {
    font-size: 20px;
    margin-bottom: 16px;
  }
}

@media (max-width: 767px) {
  .azur-related-section__title {
    font-size: 18px;
  }
}

/* ====================
   SMART CART WIDGET (all screens)
   ==================== */

/* Hide default WC quantity input on single product */
.azur-product-summary .quantity,
.azur-product-summary .qty {
  display: none;
}

.azur-product-summary .single_add_to_cart_button.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Quantity Widget: [−] count [+] */
.azb-qty-widget {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  border: 2px solid #000;
  overflow: hidden;
}

.azb-qty-widget.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.azb-qty-widget__btn {
  flex: 0 0 60px;
  padding: 18px 0;
  font-size: 22px;
  font-weight: 700;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  line-height: 1;
}

.azb-qty-widget__btn:hover {
  background: #f0f0f0;
}

.azb-qty-widget__count {
  flex: 1;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 700;
  background: #000;
  color: #fff;
  border: none;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: center;
  line-height: 1;
}

.azb-qty-widget__count:hover {
  background: #333;
}

@media (max-width: 991px) {
  .azb-qty-widget__btn {
    flex: 0 0 50px;
    padding: 15px 0;
    font-size: 20px;
  }

  .azb-qty-widget__count {
    padding: 15px 0;
    font-size: 16px;
  }
}

/* ====================
   SIZE CHART TAB
   ==================== */

.azurbrand-size-chart {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.azurbrand-size-chart table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #1a1a1a;
  table-layout: auto;
}

.azurbrand-size-chart table th,
.azurbrand-size-chart table td {
  padding: 14px 20px;
  text-align: left;
  border: 1px solid #e8e8e8;
  font-weight: 400;
  vertical-align: middle;
  white-space: nowrap;
}

.azurbrand-size-chart table th {
  font-weight: 600;
}

.azurbrand-size-chart table tbody tr {
  transition: background-color 0.15s ease;
}

.azurbrand-size-chart table tbody tr:hover {
  background-color: #f7f7f7;
}

@media (max-width: 767px) {
  .azurbrand-size-chart table th,
  .azurbrand-size-chart table td {
    padding: 10px 14px;
    font-size: 13px;
  }
}
