/*
Theme Name: Astra Child
Theme URI:  https://example.com/
Description: Child theme of Astra
Author:      Your Name
Author URI:  https://example.com/
Template:    astra
Version:     1.0.0
Text Domain: astra-child
*/

/************************************/
/* WordPress Dynamic Search Bar CSS */
/************************************/
.wp-search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 40px auto;
    padding: 20px 0;
    text-align: center;
}

.wp-search-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wp-search-wrapper:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.wp-search-wrapper:focus-within {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 1);
}

.wp-search-form {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.wp-search-input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    padding: 18px 24px !important;
    font-size: 18px !important;
    background: transparent !important;
    color: #333 !important;
    font-weight: 400 !important;
    letter-spacing: 0.3px !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

.wp-search-input::placeholder {
    color: #888;
    font-weight: 300;
}

.wp-search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 15px 24px !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    min-width: 120px !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.wp-search-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.wp-search-button:active {
    transform: scale(0.98);
}

.wp-search-icon {
    width: 20px !important;
    height: 20px !important;
    transition: transform 0.3s ease !important;
    display: inline-block !important;
    vertical-align: middle !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

.wp-search-button:hover .wp-search-icon {
    transform: rotate(90deg);
}

/* Loading state */
.wp-search-wrapper.loading .wp-search-button {
    background: #ccc;
    cursor: not-allowed;
}

.wp-search-wrapper.loading .wp-search-icon {
    animation: wp-search-spin 1s linear infinite;
}

@keyframes wp-search-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wp-search-container {
        max-width: 90%;
    }
    
    .wp-search-input {
        font-size: 16px;
        padding: 16px 20px;
    }
    
    .wp-search-button {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 100px;
    }
}

/* === Controls: single source of truth for height/radius/colors === */
:root {
  --wp-search-control-size: 48px;
  --wp-search-radius: 24px;
  --wp-search-brand-1: #667eea;
  --wp-search-brand-2: #764ba2;
  --wp-search-ring: 0 0 0 4px rgba(102, 126, 234, 0.25);
}

/* Ensure the wrapper allows absolute-positioned autocomplete */
.wp-search-wrapper {
  position: relative;
  padding: 6px;                   /* tighter padding so controls align cleanly */
  border-radius: var(--wp-search-radius);
}

/* Equal heights for input + button */
.wp-search-form {
  display: flex !important;
  align-items: stretch !important;  /* stretch both controls to same height */
  gap: 10px !important;
}

.wp-search-input {
  height: var(--wp-search-control-size) !important;
  line-height: var(--wp-search-control-size) !important;
  padding: 0 16px !important;
  border-radius: calc(var(--wp-search-radius) - 2px) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  background: #fff !important;
}

/* Prettier button: glassy gradient, clear focus ring, same height */
.wp-search-button {
  height: var(--wp-search-control-size) !important;
  padding: 0 20px !important;
  border-radius: var(--wp-search-radius) !important;
  background: linear-gradient(135deg, var(--wp-search-brand-1), var(--wp-search-brand-2)) !important;
  color: #fff !important;
  border: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: .5px !important;
  box-shadow: 0 6px 18px rgba(118, 75, 162, .35) !important;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease !important;
}

.wp-search-button:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.05); }
.wp-search-button:active { transform: translateY(0) scale(.98); }
.wp-search-wrapper:focus-within { box-shadow: var(--wp-search-ring); }

/* Icon tweaks (works with the inline SVG above) */
.wp-search-icon {
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
}

/* === Autocomplete dropdown === */
.wp-search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.06);
  max-height: 280px;
  overflow: auto;
  z-index: 1000;
}

.wp-search-autocomplete[hidden] { display: none !important; }

.wp-search-autocomplete-item {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-search-autocomplete-item:hover,
.wp-search-autocomplete-item.highlighted,
.wp-search-autocomplete-item[aria-selected="true"] {
  background: rgba(102, 126, 234, 0.08);
}

/* Responsive niceties */
@media (max-width: 768px) {
  :root { --wp-search-control-size: 44px; }
  .wp-search-button { font-size: 14px !important; }
}