/**
 * WB Site Builder - Frontend & Layout Styles
 *
 * Semantic, accessible styling for all builder elements, responsive containers,
 * layout flexbox/grid, and WooCommerce widgets.
 *
 * @package WBSiteBuilder
 * @version 1.0.0
 */

/* Layout Container Reset & Base */
.wb-sb-layout {
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
}

.wb-sb-layout *,
.wb-sb-layout *::before,
.wb-sb-layout *::after {
  box-sizing: inherit;
}

/* Container & Inner Container */
.wb-sb-container,
.wb-sb-inner_container {
  width: 100%;
  position: relative;
  transition: all 0.2s ease;
}

.wb-sb-container-inner {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: inherit;
  flex-direction: inherit;
  justify-content: inherit;
  align-items: inherit;
  flex-wrap: inherit;
  gap: inherit;
  grid-template-columns: inherit;
}

/* Multi-column layout */
.wb-sb-columns {
  width: 100%;
}

.wb-sb-columns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.wb-sb-column {
  flex: 1 1 0%;
  min-width: 0;
}

.wb-sb-column-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Responsive Columns Overrides */
@media (max-width: 767px) {
  .wb-sb-columns-row {
    flex-direction: column;
  }
  .wb-sb-column {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* Responsive Visibility Helpers */
@media (min-width: 992px) {
  .wb-hide-desktop {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .wb-hide-tablet {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .wb-hide-mobile {
    display: none !important;
  }
}

/* Headings */
.wb-sb-heading {
  margin: 0 0 0.5em 0;
  line-height: 1.25;
  color: inherit;
}

.wb-sb-heading a {
  color: inherit;
  text-decoration: none;
}

.wb-sb-heading a:hover {
  opacity: 0.85;
}

/* Text Editor */
.wb-sb-text {
  line-height: 1.7;
  color: inherit;
}

.wb-sb-text p {
  margin: 0 0 1em 0;
}

.wb-sb-text p:last-child {
  margin-bottom: 0;
}

/* Images */
.wb-sb-image {
  margin: 0;
}

.wb-sb-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: inherit;
}

.wb-sb-caption {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 6px;
  text-align: center;
}

/* Buttons */
.wb-sb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.wb-sb-button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.wb-sb-button:active {
  transform: translateY(0);
}

.wb-btn-xs { padding: 6px 12px; font-size: 0.75rem; }
.wb-btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.wb-btn-md { padding: 12px 24px; font-size: 1rem; }
.wb-btn-lg { padding: 16px 32px; font-size: 1.125rem; }
.wb-btn-xl { padding: 20px 40px; font-size: 1.25rem; }

.wb-btn-solid {
  background-color: #1d4ed8;
  color: #ffffff;
}

.wb-btn-outline {
  background-color: transparent;
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.wb-btn-ghost {
  background-color: transparent;
  color: #1d4ed8;
}

/* Video */
.wb-sb-video-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.wb-ratio-16-9 { padding-top: 56.25%; }
.wb-ratio-4-3  { padding-top: 75%; }
.wb-ratio-1-1  { padding-top: 100%; }
.wb-ratio-21-9 { padding-top: 42.85%; }

.wb-sb-video-wrapper iframe,
.wb-sb-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Divider */
.wb-sb-divider {
  width: 100%;
  padding: 10px 0;
}

.wb-sb-divider-line {
  border: 0;
  border-top: 2px solid #e2e8f0;
  margin: 0;
}

/* Spacer */
.wb-sb-spacer {
  width: 100%;
  min-height: 1px;
}

/* Icon */
.wb-sb-icon {
  display: inline-block;
}

.wb-sb-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.wb-icon-shape-circle {
  border-radius: 50%;
  padding: 12px;
}

.wb-icon-shape-square {
  border-radius: 8px;
  padding: 12px;
}

.wb-sb-icon-wrap svg {
  display: block;
}

/* Icon Box & Image Box */
.wb-sb-icon-box,
.wb-sb-image-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.wb-box-top {
  flex-direction: column;
  align-items: flex-start;
}

.wb-box-left {
  flex-direction: row;
}

.wb-box-right {
  flex-direction: row-reverse;
}

.wb-sb-box-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
}

.wb-sb-box-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #64748b;
}

.wb-sb-box-image img {
  max-width: 80px;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Lists */
.wb-sb-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wb-sb-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  line-height: 1.5;
}

.wb-list-bullet {
  list-style-type: disc;
  padding-left: 1.5rem;
}

.wb-list-bullet li {
  display: list-item;
}

.wb-list-numbered {
  list-style-type: decimal;
  padding-left: 1.5rem;
}

.wb-list-numbered li {
  display: list-item;
}

.wb-list-icon .wb-list-icon {
  display: inline-flex;
  color: #10b981;
}

.wb-list-icon svg {
  width: 18px;
  height: 18px;
}

/* WordPress Core Widgets */
.wb-sb-logo-link img {
  max-height: 60px;
  width: auto;
  display: block;
}

.wb-sb-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.wb-sb-menu ul {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.wb-nav-vertical ul {
  flex-direction: column;
  gap: 10px;
}

.wb-sb-menu a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.wb-sb-menu a:hover {
  opacity: 0.75;
}

/* Posts List Grid */
.wb-sb-posts-grid {
  display: grid;
  gap: 24px;
  width: 100%;
}

.wb-grid-cols-1 { grid-template-columns: 1fr; }
.wb-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wb-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wb-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 991px) {
  .wb-grid-cols-3,
  .wb-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .wb-grid-cols-2,
  .wb-grid-cols-3,
  .wb-grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

.wb-sb-post-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.wb-post-card-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.wb-post-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.wb-post-card-title {
  font-size: 1.15rem;
  margin: 0 0 8px 0;
}

.wb-post-card-title a {
  color: inherit;
  text-decoration: none;
}

.wb-post-card-date {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.wb-post-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* WooCommerce Widgets */
.wb-sb-product-title {
  margin: 0 0 10px 0;
}

.wb-sb-product-image-box img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 8px;
}

.wb-product-img-mock {
  width: 100%;
  min-height: 320px;
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  font-weight: 500;
}

.wb-sb-product-price-box {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 10px 0;
}

.wb-sb-product-price-box del {
  color: #94a3b8;
  font-size: 1.15rem;
  margin-right: 8px;
}

.wb-sb-product-price-box ins {
  text-decoration: none;
  color: #16a34a;
}

.wb-mock-cart {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}

.wb-mock-cart .qty {
  width: 60px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
}

.wb-mock-cart button {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.wb-sb-product-grid ul.products {
  display: grid;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.wb-mock-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
}

.wb-mock-grid-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  background: #fff;
}

.wb-mock-thumb {
  height: 140px;
  background: #f1f5f9;
  border-radius: 6px;
  margin-bottom: 10px;
}

.wb-mock-btn {
  display: inline-block;
  background: #0284c7;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Phase 3 & 4 Theme and Global Site Parts compatibility */
.wb-sb-global-header,
.wb-sb-global-footer {
  width: 100%;
  box-sizing: border-box;
  background: #172033;
  color: #ffffff;
  padding: 16px 24px;
}

.wb-sb-global-header-inner,
.wb-sb-global-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.wb-sb-global-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wb-sb-brand {
  color: inherit;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
}

.wb-sb-brand img {
  max-height: 56px;
  width: auto;
  display: block;
}

.wb-sb-global-nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.wb-sb-global-nav a {
  color: inherit;
  text-decoration: none;
}

.wb-sb-global-nav a:hover,
.wb-sb-brand:hover {
  opacity: 0.82;
}

.wb-sb-global-footer {
  margin-top: 36px;
}

.wb-sb-home-hero {
  padding: clamp(48px, 9vw, 120px) 24px;
  text-align: center;
  background: #f1f5f9;
}

.wb-sb-home-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.wb-sb-home-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin: 0 0 20px;
}

.wb-sb-home-hero p {
  font-size: 1.15rem;
  line-height: 1.7;
  margin: 0 auto 28px;
}

.wb-sb-home-hero .wb-sb-button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 5px;
  background: #172033;
  color: #fff;
  text-decoration: none;
}

.wb-sb-product-intro {
  padding: 12px 16px;
  margin: 0 0 20px;
  background: #f1f5f9;
  border-left: 4px solid #334155;
}
