/* CablesCat - Utilities */

/* Layout */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* Text */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-white  { color: var(--white); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.font-bold   { font-weight: 700; }
.font-600    { font-weight: 600; }

/* Display */
.d-none  { display: none; }
.d-block { display: block; }

/* Divider */
.divider {
  height: 1px; background: var(--border); margin: 1.5rem 0;
}

/* Badge */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700;
}
.badge-blue    { background: rgba(37,99,235,0.2);  color: var(--accent-light); }
.badge-green   { background: rgba(16,185,129,0.2); color: var(--success); }
.badge-red     { background: rgba(239,68,68,0.2);  color: var(--danger); }
.badge-yellow  { background: rgba(245,158,11,0.2); color: var(--warning); }

/* Card */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}

/* Input */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.5rem;
}
.form-control {
  width: 100%; padding: 0.85rem 1.1rem;
  border-radius: 10px; font-family: inherit; font-size: 0.9rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--white); transition: var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus { outline: none; border-color: var(--accent); background: rgba(37,99,235,0.06); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

/* Required asterisk */
.required::after { content: ' *'; color: var(--danger); }

/* Section gradient overlays */
.overlay-top {
  background: linear-gradient(0deg, var(--dark) 0%, transparent 100%);
  height: 100px; margin-top: -100px; position: relative; z-index: 1;
}

/* Stock badge */
.in-stock  { color: var(--success); font-weight: 600; }
.out-stock { color: var(--danger);  font-weight: 600; }

/* View all link */
.view-all {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--accent-light); font-weight: 600; font-size: 0.9rem;
}
.view-all:hover { color: var(--white); gap: 0.75rem; }

/* Section actions */
.section-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}

/* Qty controls (product page + cart) */
.qty-controls { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-btn {
  width: 40px; height: 40px; background: rgba(255,255,255,0.06);
  color: var(--text); font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.qty-btn:hover { background: var(--accent); color: var(--white); }
.qty-value { width: 48px; text-align: center; color: var(--white); font-weight: 600; }
#quantity-input {
  width: 56px; text-align: center;
  background: transparent; border: none; color: var(--white);
  font-family: inherit; font-size: 1rem; font-weight: 600; padding: 0;
}

/* Cart item layout */
.cart-item {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1rem;
}
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-details h3 { font-size: 0.95rem; font-weight: 600; color: var(--white); margin-bottom: 0.25rem; white-space: normal; overflow-wrap: break-word; word-break: break-word; }
.cart-item-price { font-size: 0.875rem; color: var(--text-muted); }
.cart-item-controls { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cart-item-subtotal { font-weight: 700; color: var(--accent-light); min-width: 60px; text-align: right; flex-shrink: 0; }
.cart-remove { width: 36px; height: 36px; border-radius: 8px; background: rgba(239,68,68,0.1); color: var(--danger); font-size: 0.9rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.cart-remove:hover { background: var(--danger); color: var(--white); }

/* Checkout form layout */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; }
.order-summary { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; position: sticky; top: 90px; }
.order-summary h2 { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 1.25rem; }
.order-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.order-item:last-of-type { border-bottom: none; }
.order-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.order-item-info { flex: 1; }
.order-item-info p { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.order-item-info small { font-size: 0.78rem; color: var(--text-muted); }
.order-item span { font-weight: 700; color: var(--accent-light); font-size: 0.9rem; }
.order-total-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0 0; border-top: 1px solid var(--border); margin-top: 0.5rem; }
.order-total-row .label { font-weight: 700; color: var(--white); }
.order-total-row .value { font-size: 1.25rem; font-weight: 800; color: var(--accent-light); }

@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
}

/* Shop layout */
.shop-layout { display: flex; gap: 2rem; align-items: flex-start; }
.shop-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  position: sticky; top: 90px;
}
.shop-main { flex: 1; min-width: 0; }
.sidebar-title { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 1rem; }
.filter-btn {
  display: block; width: 100%; text-align: left;
  padding: 0.6rem 0.85rem; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  background: transparent; transition: var(--transition); margin-bottom: 0.25rem;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(37,99,235,0.15); color: var(--white);
}
.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1.25rem;
}
.search-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 1rem; flex: 1; max-width: 320px;
}
.search-bar i { color: var(--text-muted); }
.search-bar input {
  background: transparent; border: none; color: var(--white);
  font-family: inherit; font-size: 0.875rem; padding: 0.6rem 0;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { outline: none; }
select.sort-select {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 1rem; color: var(--text);
  font-family: inherit; font-size: 0.875rem; cursor: pointer;
}

/* Product detail page */
.product-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.product-gallery .main-image-wrap {
  aspect-ratio: 420/600; background: var(--secondary);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); cursor: zoom-in;
}
.product-gallery .main-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-gallery .main-image-wrap:hover img { transform: scale(1.1); }
.product-thumbnails { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--border); cursor: pointer; transition: var(--transition);
}
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { display: flex; flex-direction: column; gap: 1rem; }
.product-info-title { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 800; color: var(--white); }
.product-pricing-large { display: flex; align-items: baseline; gap: 1rem; }
.price-large { font-size: 2rem; font-weight: 800; color: var(--accent-light); }
.price-old-large { font-size: 1.1rem; color: var(--text-muted); text-decoration: line-through; }
.product-features-list { display: flex; flex-direction: column; gap: 0.5rem; }
.product-features-list li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; color: var(--text-muted); }
.product-features-list li i { color: var(--success); margin-top: 2px; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: 0.65rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.specs-table td:first-child { color: var(--text-muted); font-weight: 600; width: 40%; }
.specs-table td:last-child { color: var(--text); }
.add-to-cart-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; }
.contact-info-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.contact-info-icon { width: 46px; height: 46px; border-radius: 12px; background: rgba(37,99,235,0.15); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--accent-light); flex-shrink: 0; }
.contact-info-text h4 { font-size: 0.9rem; font-weight: 700; color: var(--white); margin-bottom: 0.25rem; }
.contact-info-text p { font-size: 0.875rem; color: var(--text-muted); }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.map-embed iframe { width: 100%; height: 280px; border: none; filter: grayscale(80%) invert(90%); }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
}
