/*
Plugin Name: Quartz Stone Shop Filter
Description: Styles for Quartz Stone Shop Listing
*/

:root {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e1dfda;
  --page-bg: #ffffff;
}

.quartz-stone-wrapper {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  line-height: 1.5;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.quartz-stone-wrapper * {
  box-sizing: border-box;
}

.quartz-stone-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.quartz-stone-wrapper a {
  color: inherit;
  text-decoration: none;
}

.quartz-stone-wrapper ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- TOOLBAR ---------- */
.quartz-stone-wrapper .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 40px;
  background: #f7f6f4;
  border-bottom: 1px solid var(--line);
}

.quartz-stone-wrapper .toolbar h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.quartz-stone-wrapper .toolbar-right {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13px;
}

.quartz-stone-wrapper .toolbar-right .count {
  color: var(--muted);
}

.quartz-stone-wrapper .dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--ink);
  padding: 8px 12px;
}

.quartz-stone-wrapper .dd-btn .chev {
  font-size: 10px;
  color: var(--muted);
}

.quartz-stone-wrapper .sort-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
}

/* ---------- FILTER BAR ---------- */
.quartz-stone-wrapper .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  padding: 14px 40px;
  background: #f0efec;
  border-bottom: 1px solid var(--line);
}

.quartz-stone-wrapper .filter-dropdown-wrap {
  position: relative;
}

.quartz-stone-wrapper .filter-bar .dd-btn {
  font-size: 12px;
  letter-spacing: .3px;
  padding: 4px 0;
}

.quartz-stone-wrapper .filter-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 220px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 8px 0;
  z-index: 10;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}

/* Hide WordPress injected br and p tags */
.quartz-stone-wrapper .filter-dropdown-content br,
.quartz-stone-wrapper .filter-dropdown-content p {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.quartz-stone-wrapper .filter-dropdown-content::-webkit-scrollbar {
  width: 6px;
}
.quartz-stone-wrapper .filter-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}
.quartz-stone-wrapper .filter-dropdown-content::-webkit-scrollbar-thumb {
  background-color: #ddd;
  border-radius: 10px;
}

.quartz-stone-wrapper .filter-dropdown-content label {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #1a1a1a;
  margin: 0 !important;
  padding: 10px 20px !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
  line-height: 1.2;
}

.quartz-stone-wrapper .filter-dropdown-content label:hover {
  background-color: #f5f5f5;
}

.quartz-stone-wrapper .filter-dropdown-content label input {
  margin: 0 10px 0 0 !important;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1a1a1a;
}

/* ---------- PRODUCTS ---------- */
.quartz-stone-wrapper ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 36px 28px !important;
  padding: 40px 24px !important;
  margin: 0 !important;
  list-style: none !important;
}

.quartz-stone-wrapper ul.products li.product {
  display: block;
  margin: 0 !important;
  width: 100% !important;
}

.quartz-stone-wrapper .woocommerce-loop-product__link {
  display: block;
}

.quartz-stone-wrapper .attachment-woocommerce_thumbnail {
  width: 100%;
  aspect-ratio: 16/10;
  background: #eee;
  object-fit: cover;
}

.quartz-stone-wrapper .woocommerce-loop-product__title {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  text-align: left;
  padding: 0;
}

/* Loading Overlay for AJAX */
.quartz-loading {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 900px) {
  .quartz-stone-wrapper ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 24px !important;
  }
  .quartz-stone-wrapper .toolbar, 
  .quartz-stone-wrapper .filter-bar {
    padding: 16px 20px;
  }
}

@media (max-width: 520px) {
  .quartz-stone-wrapper ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- QUICK VIEW ---------- */
.quartz-stone-wrapper .product-image-wrap {
  position: relative;
  overflow: hidden;
}

.quartz-stone-wrapper .quick-view-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.quartz-stone-wrapper .quick-view-overlay-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

.quartz-stone-wrapper .product-image-wrap:hover .quick-view-overlay {
  opacity: 1;
}

.quartz-stone-wrapper .quick-view-btn {
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1a1a1a;
  text-decoration: none;
  transform: translateY(20px);
  transition: transform 0.3s ease, background 0.3s;
  z-index: 2;
  position: relative;
  outline: none;
}

.quartz-stone-wrapper button:focus,
.quartz-stone-wrapper a:focus,
.quartz-modal-close:focus {
  outline: none !important;
}

.quartz-stone-wrapper .quick-view-btn:hover {
  background: #f0f0f0;
}

.quartz-stone-wrapper .product-image-wrap:hover .quick-view-btn {
  transform: translateY(0);
}

.quartz-stone-wrapper .quick-view-btn .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
}

/* ---------- MODAL ---------- */
.quartz-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
}

.quartz-modal.quartz-show {
  display: flex;
}

.quartz-modal-content {
  position: relative;
  background-color: #fff;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.quartz-modal-close {
  color: #333;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}

.quartz-modal-close:hover {
  color: #000;
}

.quartz-slider-container {
  position: relative;
  width: 100%;
  background: #f7f6f4;
  display: flex;
  align-items: center;
  min-height: 300px;
  overflow: hidden;
}

.quartz-slides {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease-in-out;
}

.quartz-slide {
  flex: 0 0 100%;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.quartz-slide-btn {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 16px;
  color: #1a1a1a;
  font-weight: bold;
  font-size: 20px;
  transition: 0.3s ease;
  border-radius: 3px;
  user-select: none;
  background: rgba(255,255,255,0.7);
  border: none;
}

.quartz-slide-btn:hover {
  background: rgba(255,255,255,1);
}

.quartz-slide-prev {
  left: 10px;
}

.quartz-slide-next {
  right: 10px;
}
