/*
Theme Name: Shoptimizer - PrintSpace Style
Theme URI: https://printley.lt
Description: Shoptimizer child theme with PrintSpace styling
Author: Printley
Author URI: https://printley.lt
Template: shoptimizer
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shoptimizer-printspace-child
*/

/* ============================================
   PRINTSPACE COLOR SCHEME & VARIABLES
   ============================================ */

:root {
  /* Primary Colors - Printley Orange */
  --cl-primary: #f26522;
  --cl-secondary: #d35400;
  --cl-text: #7e7e7e;
  --cl-heading: #000;
  --cl-link: #7e7e7e;
  --cl-link-hover: #f26522;
  --cl-border: #eee;
  
  /* Fonts */
  --font-primary: 'Inter', sans-serif;
  --font-secondary: 'Inter', sans-serif;
  --font-menu: 'Inter', sans-serif;
  
  /* Border Radius */
  --border-radius: 12px;
  --border-radius-small: 3px;
  --border-radius-medium: 5px;
  --border-radius-large: 10px;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
  font-family: var(--font-primary);
  color: var(--cl-text);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--cl-heading);
  font-weight: 500;
}

a {
  color: var(--cl-link);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--cl-link-hover);
}

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
  background-color: #fff;
  border-bottom: 1px solid var(--cl-border);
}

.main-navigation a {
  font-family: var(--font-menu);
  font-weight: 500;
  color: #000;
  font-size: 16px;
}

.main-navigation a:hover {
  color: var(--cl-primary);
}

/* ============================================
   BUTTONS
   ============================================ */

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background-color: var(--cl-primary);
  color: #fff;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-weight: 500;
  padding: 12px 24px;
  border: none;
  transition: all 0.3s ease;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
  background-color: var(--cl-secondary);
  color: #fff;
}

/* ============================================
   WOOCOMMERCE PRODUCT STYLES
   ============================================ */

.woocommerce ul.products li.product {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: var(--cl-heading);
  font-family: var(--font-primary);
  font-weight: 500;
}

.woocommerce ul.products li.product .price {
  color: var(--cl-primary);
  font-weight: 500;
}

.woocommerce span.onsale {
  background-color: var(--cl-primary);
  border-radius: var(--border-radius-small);
}

/* ============================================
   FORMS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea,
select {
  border: 1px solid var(--cl-border);
  border-radius: var(--border-radius-small);
  padding: 10px 15px;
  font-family: var(--font-primary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  border-color: var(--cl-primary);
  outline: none;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background-color: var(--cl-secondary);
  color: #fff;
}

.site-footer a {
  color: #fff;
}

.site-footer a:hover {
  color: var(--cl-primary);
}

/* ============================================
   PRINTSPACE SPECIFIC COMPONENTS
   ============================================ */

/* Rounded corners for images */
img,
.wp-post-image,
.woocommerce-product-gallery__image {
  border-radius: var(--border-radius);
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--cl-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cl-secondary);
}

/* Smooth transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Selection color */
::selection {
  background-color: var(--cl-primary);
  color: #fff;
}

/* Focus styles */
:focus {
  outline: 2px solid var(--cl-primary);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  :root {
    --border-radius: 8px;
  }

  body {
    font-size: 15px;
  }
}

/* ============================================
   Related-categories sidebar widget — highlight the current category
   ============================================ */

.widget_product_categories.printley_related_categories ul.product-categories li.current-cat > a {
  font-weight: 700;
  color: var(--primary, #1d68f0);
}

.widget_product_categories.printley_related_categories ul.product-categories li.current-cat {
  position: relative;
}

.widget_product_categories.printley_related_categories ul.product-categories li.current-cat > a::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0.55em;
  width: 4px;
  height: 0.7em;
  background: var(--primary, #1d68f0);
  border-radius: 2px;
}

.widget_product_categories.printley_related_categories ul.product-categories .count {
  color: #8a8a8a;
  font-size: 0.85em;
}

/* ============================================
   Active filters widget — removable chips + clear-all
   ============================================ */

.printley_active_filters ul.printley-active-filters {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.printley_active_filters ul.printley-active-filters li.chosen {
  margin: 0;
  padding: 0;
}

.printley_active_filters ul.printley-active-filters li.chosen > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  background: #fdf0ea;
  border: 1px solid var(--cl-primary, #f26522);
  border-radius: 16px;
  color: #1f2937;
  font-size: 0.85em;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.printley_active_filters ul.printley-active-filters li.chosen > a .pf-attr {
  color: #6b7280;
  font-weight: 500;
}

/* Trailing ✕ glyph rendered via ::after so it isn't part of the term text */
.printley_active_filters ul.printley-active-filters li.chosen > a::after {
  content: "\00d7";
  font-size: 1.15em;
  line-height: 1;
  color: var(--cl-primary, #f26522);
  font-weight: 700;
}

.printley_active_filters ul.printley-active-filters li.chosen > a:hover {
  background: var(--cl-primary, #f26522);
  color: #fff;
}

.printley_active_filters ul.printley-active-filters li.chosen > a:hover .pf-attr,
.printley_active_filters ul.printley-active-filters li.chosen > a:hover::after {
  color: #fff;
}

a.printley-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--cl-primary, #f26522);
  text-decoration: none;
}

a.printley-clear-filters::before {
  content: "\00d7";
  font-size: 1.2em;
  line-height: 1;
  font-weight: 700;
}

a.printley-clear-filters:hover {
  text-decoration: underline;
}

/* Hide the stock price-filter "Filtruoti" submit button (orange theme .button
   that reads as a stray search button). The slider auto-applies on drag-end via
   inc/price-filter-auto.js, so the button is redundant. */
.widget_price_filter .price_slider_amount button[type="submit"] {
  display: none;
}

/* Hide the mobile filter-drawer close (✕) button. Parent theme shows it via
   `.filter-open .filters.close-drawer` (specificity 0,3,0) — match + !important
   to override. Not needed: tapping the dark overlay also closes the drawer, so
   mobile users aren't trapped. Desktop never shows it anyway. */
.filter-open .filters.close-drawer,
.filters.close-drawer {
  display: none !important;
}

/* ============================================
   AJAX filtering — loading state on the product grid
   ============================================ */

#primary.printley-filtering {
  position: relative;
  min-height: 200px;
}

#primary.printley-filtering > * {
  opacity: 0.4;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

#primary.printley-filtering::after {
  content: "";
  position: absolute;
  top: 80px;
  left: 50%;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--cl-primary, #f26522);
  border-radius: 50%;
  animation: printley-spin 0.7s linear infinite;
  z-index: 5;
}

@keyframes printley-spin {
  to { transform: rotate(360deg); }
}
