/*
Theme Name: ByteMastermind Shop
Theme URI: https://shop.bytemastermind.com
Description: Clean, minimal WooCommerce child theme for ByteMastermind — embedded systems, IoT hardware & 3D printing.
Author: ByteMastermind
Author URI: https://bytemastermind.com
Template: storefront
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bytemastermind
*/

/* ==========================================================================
   ByteMastermind Shop — Clean Minimal Design
   ========================================================================== */

/* ---------- Base ---------- */
:root {
  --bm-bg: #ffffff;
  --bm-text: #111827;
  --bm-text-muted: #6b7280;
  --bm-border: #e5e7eb;
  --bm-surface: #f9fafb;
  --bm-accent: #111827;
  --bm-radius: 0.75rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--bm-text);
  background: var(--bm-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bm-border);
  box-shadow: none;
}

.site-header .col-full {
  max-width: 80rem;
}

.site-branding {
  float: none;
}

.site-title a,
.site-title a:hover {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bm-text);
  text-decoration: none;
}

.site-description {
  display: none;
}

/* ---------- Navigation ---------- */
.main-navigation ul li a,
.main-navigation ul.menu > li > a,
.site-header-cart a,
.site-header-cart .cart-contents {
  font-size: 0.875rem;
  color: var(--bm-text-muted);
  text-transform: none;
  font-weight: 400;
}

.main-navigation ul li a:hover,
.main-navigation ul.menu > li > a:hover {
  color: var(--bm-text);
}

.main-navigation ul li.current-menu-item > a {
  color: var(--bm-text);
  font-weight: 500;
}

/* Cart icon in header */
.site-header-cart .cart-contents .count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bm-text);
  background: none;
  border: none;
}

/* ---------- Layout ---------- */
.col-full {
  max-width: 80rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .col-full {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .col-full {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.content-area {
  width: 100%;
}

/* Remove default sidebar for shop pages */
.woocommerce-page .content-area {
  width: 100%;
}

.woocommerce-page #secondary {
  display: none;
}

/* ---------- Product Cards ---------- */
ul.products li.product {
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  overflow: hidden;
  background: var(--bm-bg);
  transition: box-shadow 0.2s ease;
  padding: 0;
  margin-bottom: 2rem;
}

ul.products li.product:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

ul.products li.product a img {
  margin: 0;
  border-radius: 0;
  transition: transform 0.3s ease;
}

ul.products li.product:hover a img {
  transform: scale(1.05);
}

ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bm-text);
  padding: 1rem 1rem 0.25rem;
}

ul.products li.product .price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bm-text);
  padding: 0 1rem 1rem;
}

ul.products li.product .price del {
  opacity: 0.5;
}

/* Category badge */
ul.products li.product .product-category {
  display: inline-block;
  margin: 1rem 1rem 0;
  padding: 0.125rem 0.5rem;
  font-size: 0.875rem;
  background: var(--bm-surface);
  color: var(--bm-text-muted);
  border-radius: 9999px;
}

/* Product image container */
ul.products li.product a {
  overflow: hidden;
  display: block;
}

/* ---------- Add to Cart Button ---------- */
ul.products li.product .button,
.single-product .product .single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background-color: var(--bm-accent);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  text-transform: none;
  letter-spacing: 0;
  transition: opacity 0.2s ease;
}

ul.products li.product .button:hover,
.single-product .product .single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
  background-color: var(--bm-accent);
  opacity: 0.85;
}

/* Add to cart on product cards */
ul.products li.product .button {
  margin: 0 1rem 1rem;
  width: calc(100% - 2rem);
  text-align: center;
}

/* ---------- Single Product ---------- */
.single-product .product .summary {
  padding-top: 0;
}

.single-product .product .product_title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--bm-text);
}

.single-product .product .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bm-text);
}

.single-product .product .woocommerce-product-details__short-description {
  color: var(--bm-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Product gallery */
.single-product .product .woocommerce-product-gallery {
  margin-bottom: 2rem;
}

.single-product .product .woocommerce-product-gallery img {
  border-radius: var(--bm-radius);
}

/* Tabs */
.woocommerce-tabs ul.tabs {
  border-bottom: 1px solid var(--bm-border);
  padding: 0;
}

.woocommerce-tabs ul.tabs li {
  border: none;
  background: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.woocommerce-tabs ul.tabs li a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bm-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
}

.woocommerce-tabs ul.tabs li.active a {
  color: var(--bm-text);
  border-bottom-color: var(--bm-accent);
}

/* ---------- Cart Page ---------- */
/* Cart table: airy row layout, remove heavy borders */
.woocommerce-cart table.shop_table {
  border: none;
  border-radius: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.woocommerce-cart table.shop_table thead th {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--bm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--bm-border);
  padding-bottom: 0.5rem;
}

.woocommerce-cart table.shop_table tbody tr {
  border-bottom: 1px solid var(--bm-border);
}

/* Product thumbnail: 64px, rounded, object-fit */
.woocommerce-cart .product-thumbnail img {
  width: 64px !important;
  height: 64px !important;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Product name */
.woocommerce-cart .product-name a {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bm-text);
}

/* Cart totals: contained card */
.cart-collaterals .cart_totals {
  background: var(--bm-surface);
  border-radius: var(--bm-radius);
  padding: 1.5rem;
  border: 1px solid var(--bm-border);
}

.cart-collaterals .cart_totals h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bm-text);
  margin-bottom: 1rem;
}

/* "Update Cart" — ghost secondary action */
.woocommerce-cart .actions .button[name="update_cart"] {
  background: transparent !important;
  border: 1px solid var(--bm-border) !important;
  color: var(--bm-text-muted) !important;
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.5rem 1rem;
}

.woocommerce-cart .actions .button[name="update_cart"]:hover {
  color: var(--bm-text) !important;
  border-color: var(--bm-text) !important;
  opacity: 1 !important;
}

/* "Proceed to Checkout" — primary CTA */
.woocommerce .wc-proceed-to-checkout a.checkout-button {
  background: var(--bm-accent) !important;
  color: #ffffff !important;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  width: 100%;
  text-align: center;
  display: block;
}

/* ---------- Checkout ---------- */
/* Section headings */
.woocommerce-checkout h3,
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bm-text);
  font-style: normal;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bm-border);
}

/* Form labels */
.woocommerce-checkout .form-row label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--bm-text);
  margin-bottom: 0.25rem;
  display: block;
}

/* Form inputs — consistent with design tokens */
.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
  border: 1px solid var(--bm-border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--bm-text);
  background: var(--bm-bg);
  width: 100%;
  -webkit-appearance: none;
}

/* Focus ring — 3px soft ring (REPLACES existing 1px rule) */
.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
  border-color: var(--bm-accent);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
  outline: none;
}

/* Order review box */
#order_review_heading,
.woocommerce-checkout-review-order-table {
  background: var(--bm-surface);
  border-radius: var(--bm-radius);
  padding: 1.5rem;
  border: 1px solid var(--bm-border);
}

#order_review_heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bm-text);
  margin-bottom: 1rem;
  border: none;
  padding: 1.5rem 1.5rem 0;
}

/* "Place Order" button */
#place_order {
  background: var(--bm-accent) !important;
  color: #ffffff !important;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#place_order:hover {
  opacity: 0.88;
}

/* Payment method labels */
.woocommerce-checkout #payment .payment_methods label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bm-text);
}

.woocommerce-checkout #payment .payment_box {
  background: var(--bm-surface);
  border-radius: 0.5rem;
  border: 1px solid var(--bm-border);
}

/* ---------- Page Titles ---------- */
.woocommerce-page .entry-title,
h1.entry-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--bm-text);
  margin-bottom: 2rem;
  font-style: normal;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bm-surface);
  border-top: 1px solid var(--bm-border);
  padding: 1.5rem 0;
}

.site-footer .col-full {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-info {
  font-size: 0.875rem;
  color: var(--bm-text-muted);
}

.site-info a {
  color: var(--bm-text-muted);
}

.site-info a:hover {
  color: var(--bm-text);
}

/* Remove Storefront credit */
.site-info .site-credit {
  display: none;
}

/* ---------- Breadcrumbs ---------- */
.woocommerce-breadcrumb {
  font-size: 0.875rem;
  color: var(--bm-text-muted);
  margin-bottom: 2rem;
}

.woocommerce-breadcrumb a {
  color: var(--bm-text-muted);
}

.woocommerce-breadcrumb a:hover {
  color: var(--bm-text);
}

/* ---------- Notices / Alerts ---------- */
/* WooCommerce notices — flat style with left accent */
/* NOTE: border shorthand sets all 4 sides, then border-top overrides Storefront's colored top border */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 0.5rem;
  border: 1px solid var(--bm-border);
  border-top: 1px solid var(--bm-border) !important;
  border-left: 4px solid var(--bm-accent);
  background: var(--bm-surface);
  color: var(--bm-text);
  font-size: 0.875rem;
  box-shadow: none;
}

.woocommerce-error {
  border-left-color: #b91c1c;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--bm-accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 0;
  }

  ul.products li.product {
    margin-bottom: 1rem;
  }

  .single-product .product .product_title {
    font-size: 1.5rem;
  }
}

/* ---------- Product Grid ---------- */
@media (min-width: 768px) {
  ul.products.columns-3 li.product,
  ul.products.columns-4 li.product {
    width: calc(33.333% - 1.5rem);
    margin-right: 1.5rem;
  }
}

@media (max-width: 767px) {
  ul.products li.product {
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* ---------- Star Rating ---------- */
.star-rating span::before {
  color: var(--bm-accent);
}

/* ---------- Sale Badge ---------- */
.onsale {
  background: var(--bm-accent);
  color: #ffffff;
  border-radius: var(--bm-radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
}

/* ---------- Pagination ---------- */
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  border-color: var(--bm-border);
  color: var(--bm-text-muted);
  border-radius: 0.375rem;
}

.woocommerce-pagination ul li span.current {
  background: var(--bm-accent);
  border-color: var(--bm-accent);
  color: #ffffff;
}

/* ---------- Quantity Input ---------- */
.quantity .qty {
  border: 1px solid var(--bm-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  width: 4rem;
  text-align: center;
}

/* ---------- Related Products ---------- */
.related.products > h2,
.up-sells > h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bm-text);
}

/* ---------- Misc ---------- */
a {
  color: var(--bm-accent);
}

a:hover {
  color: var(--bm-text);
}

/* Hide Storefront handheld footer bar on mobile — clean look */
.storefront-handheld-footer-bar {
  display: none;
}

/* Clean scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bm-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--bm-border);
  border-radius: 3px;
}
