/*
Theme Name: Laptop Spare Parts Child
Theme URI: https://laptop-spare-parts.co.za
Description: Storefront child theme for Laptop Spare Parts
Author: Laptop Mechanic
Author URI: https://laptopmechanic.co.za
Template: storefront
Version: 1.2.0
License: GPL v2 or later
Text Domain: laptop-spare-parts
*/

/* === CUSTOM STYLES - Brand colours === */

:root {
  --brand-navy: #14274F;
  --brand-navy-dark: #0E1B38;
  --brand-red: #CC0000;
  --brand-red-bright: #FF0000;
  --brand-cyan: #00BBE4;
  --brand-cyan-dark: #0099CC;
  --brand-cyan-light: #E5F9FF;
  --bg-light: #FAFBFC;
  --text-dark: #1A202C;
  --text-gray: #4A5568;
  --text-light: #718096;
  --border-light: #E2E8F0;
  --green: #38A169;
  --whatsapp: #25D366;
}

/* ===== URGENCY BAR (top of page) ===== */
.urgency-bar {
  background: var(--brand-navy-dark);
  color: white;
  text-align: center;
  padding: 6px 15px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.urgency-bar span {
  color: var(--brand-cyan);
  font-weight: 700;
}

.urgency-bar a {
  color: var(--brand-cyan) !important;
}

/* ===== HEADER - White background so logo pops ===== */
.site-header {
  background: #FFFFFF !important;
  padding: 0.5rem 0;
  border-bottom: 3px solid var(--brand-red);
}

.site-header .col-full {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.site-branding {
  flex: 0 0 auto;
  margin-right: 20px;
}

.custom-logo-link img {
  max-height: 48px;
  width: auto;
  display: block;
}

/* Hide the site title/description when logo is present */
.site-header .site-branding h1,
.site-header .site-branding .site-description {
  display: none;
}

/* Search in header - smaller, inline */
.site-header .site-search {
  flex: 0 1 280px;
  margin: 0;
  padding: 0;
}

.site-header .widget.widget_product_search form {
  margin: 0;
  display: flex;
}

.site-header .widget.widget_product_search input.search-field {
  border: 1px solid #CBD5E0;
  border-radius: 6px 0 0 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 100%;
  border-right: none;
}

.site-header .widget.widget_product_search input.search-field:focus {
  border-color: var(--brand-cyan);
  outline: none;
}

.site-header .widget.widget_product_search button {
  background: var(--brand-red);
  color: white;
  border: 1px solid var(--brand-red);
  border-radius: 0 6px 6px 0;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.site-header .widget.widget_product_search button:hover {
  background: #AA0000;
  border-color: #AA0000;
}

/* ===== PRIMARY NAVIGATION ===== */
.storefront-primary-navigation {
  background: white;
  border-bottom: 2px solid var(--border-light);
}

.storefront-primary-navigation .col-full {
  display: flex;
  align-items: center;
}

.main-navigation {
  flex: 1;
}

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.main-navigation ul li {
  position: relative;
}

.main-navigation ul li a {
  color: var(--text-gray) !important;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 10px 14px !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}

.main-navigation ul li.current-menu-item a,
.main-navigation ul li a:hover {
  color: var(--brand-red) !important;
}

/* Sub-menu styling */
.main-navigation ul ul {
  background: #FFFFFF !important;
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--brand-red);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  padding: 6px 0;
  left: 0;
}

.main-navigation ul ul li {
  border-bottom: 1px solid #F7FAFC;
}

.main-navigation ul ul a {
  color: var(--text-gray) !important;
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 8px 20px !important;
  white-space: nowrap;
}

.main-navigation ul ul li:hover > a {
  color: var(--brand-red) !important;
  background: #FFF5F5;
}

/* ===== BUTTONS ===== */
a.button,
button.button,
input.button,
#respond input#submit,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  color: white !important;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s;
}

a.button:hover,
button.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: #AA0000 !important;
  border-color: #AA0000 !important;
}

/* ===== WHATSAPP FLOAT ===== */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: var(--whatsapp);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  color: white;
}

.whatsapp-float-tooltip {
  position: fixed;
  bottom: 82px;
  right: 20px;
  z-index: 9998;
  background: white;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  font-size: 14px;
  color: #333;
  max-width: 220px;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== HERO BANNER ===== */
.hero-banner {
  background: linear-gradient(135deg, var(--brand-cyan-light) 0%, #FFFFFF 60%);
  padding: 50px 20px;
  text-align: center;
  border-bottom: 3px solid var(--brand-red);
}

.hero-banner h1 {
  font-size: 2rem;
  color: var(--brand-navy);
  margin-bottom: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.hero-banner p {
  font-size: 1.05rem;
  color: var(--text-gray);
  margin-bottom: 20px;
  line-height: 1.5;
}

.hero-search {
  max-width: 550px;
  margin: 0 auto;
  position: relative;
}

.hero-search input[type="search"] {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid var(--brand-red);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 4px 12px rgba(204,0,0,0.10);
}

.hero-search button {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 10px 20px;
  background: var(--brand-red);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: #AA0000;
}

/* ===== BRAND LINKS ===== */
.brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 50px;
  padding: 0 20px;
}

.brand-grid a {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 22px;
  font-weight: 600;
  color: var(--brand-navy);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
}

.brand-grid a:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
  box-shadow: 0 2px 8px rgba(204,0,0,0.10);
}

/* ===== CATEGORY CARDS ===== */
.cat-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto 50px;
  padding: 0 20px;
}

.cat-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
  border-top: 3px solid transparent;
}

.cat-card:hover {
  border-color: var(--brand-red);
  border-top-color: var(--brand-red);
  box-shadow: 0 8px 20px rgba(204,0,0,0.08);
  transform: translateY(-3px);
}

.cat-card .icon { font-size: 2.2rem; margin-bottom: 10px; }

.cat-card h3 {
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--brand-navy);
  font-weight: 700;
}

.cat-card .count { font-size: 0.85rem; color: var(--text-light); }

/* ===== TRUST BAR ===== */
.trust-bar {
  background: var(--brand-navy);
  padding: 36px 20px;
  color: white;
}

.trust-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
}

.trust-bar .trust-item h4 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  color: var(--brand-cyan);
}

.trust-bar .trust-item p { margin: 0; font-size: 0.9rem; color: #CBD5E0; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--brand-navy-dark) !important;
  color: #A0AEC0 !important;
}

.site-footer a { color: var(--brand-cyan) !important; }
.site-footer h1, .site-footer h2, .site-footer h3 { color: white !important; }
.footer-widgets { background: var(--brand-navy-dark) !important; }
.storefront-handheld-footer-bar { display: none; }

/* ===== PAGE TITLES ===== */
.page-title, .entry-title {
  color: var(--brand-navy);
  font-weight: 700;
}

/* ===== WOOCOMMERCE PRODUCT GRID ===== */
.woocommerce ul.products li.product {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow 0.2s;
}

.woocommerce ul.products li.product:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.9rem;
  color: var(--brand-navy);
  padding: 0;
}

.woocommerce ul.products li.product .price {
  color: var(--brand-red-bright) !important;
  font-weight: 700;
}

.woocommerce ul.products li.product .button {
  margin-top: 8px;
}

.woocommerce span.onsale {
  background: var(--brand-red) !important;
  min-width: 3em;
  min-height: 3em;
  line-height: 3em;
}

/* ===== SINGLE PRODUCT PAGE ===== */
.woocommerce div.product .product_title {
  color: var(--brand-navy);
  font-weight: 700;
}

.woocommerce div.product .price {
  color: var(--brand-red-bright) !important;
  font-weight: 700;
  font-size: 1.4rem;
}

.woocommerce div.product .summary .price {
  font-size: 1.6rem;
}

/* Breadcrumb */
.woocommerce-breadcrumb { color: var(--text-light) !important; }
.woocommerce-breadcrumb a { color: var(--brand-navy) !important; }

/* ===== ABOUT/CONTACT PAGES ===== */
.page-content-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  line-height: 1.8;
}

.page-content-section h2 { color: var(--brand-navy); }

/* ===== QUOTE FORM ===== */
.quote-form-wrap {
  max-width: 650px;
  margin: 40px auto;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--brand-red);
}

.quote-form-wrap label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--brand-navy);
  font-size: 0.9rem;
}

.quote-form-wrap input,
.quote-form-wrap select,
.quote-form-wrap textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #CBD5E0;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.quote-form-wrap input:focus,
.quote-form-wrap select:focus,
.quote-form-wrap textarea:focus {
  border-color: var(--brand-cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,187,228,0.12);
}

.quote-form-wrap textarea { min-height: 100px; }

.quote-form-wrap .submit-btn {
  background: var(--brand-red);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.quote-form-wrap .submit-btn:hover { background: #AA0000; }

/* ===== QUOTE SUCCESS ===== */
.quote-success {
  max-width: 600px;
  margin: 60px auto;
  padding: 36px;
  text-align: center;
  background: #F0FFF4;
  border: 2px solid var(--green);
  border-radius: 12px;
}

.quote-success h2 { color: var(--green); margin-bottom: 10px; }

/* ===== PAGINATION ===== */
.woocommerce nav.woocommerce-pagination ul li a:focus,
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: var(--brand-red) !important;
  color: white !important;
}

/* ===== CART / CHECKOUT ===== */
.woocommerce-cart .cart_totals h2,
.woocommerce-checkout h3 { color: var(--brand-navy); }

.woocommerce-checkout .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--brand-red);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-banner { padding: 36px 16px; }
  .hero-banner h1 { font-size: 1.5rem; }
  .brand-grid a { padding: 8px 14px; font-size: 12px; }
  .cat-card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { padding: 16px; }
  .site-header { padding: 0.4rem 0; }
  .custom-logo-link img { max-height: 36px; }
  .site-header .site-search { display: none; }
  
  /* Mobile menu button */
  .menu-toggle {
    background: var(--brand-red) !important;
    color: white !important;
    border-radius: 6px;
    padding: 8px 14px !important;
    margin: 8px 0;
  }
  
  .main-navigation.toggled ul {
    background: white;
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--brand-red);
  }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .site-header .site-search { flex: 0 1 200px; }
  .main-navigation ul li a { padding: 10px 10px !important; font-size: 0.78rem; }
}
