/*  
Theme Name: Swapdey
Theme URI: https://swapdey.com/
Author: Your Name
Author URI: https://yourwebsite.com/
Description: Custom standalone theme inspired by BackMarket
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: swapdey
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ===== BASE / RESET ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #fff;
  color: #111;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ===== TYPOGRAPHY & LINKS ===== */
a:focus,
a:active,
a.active {
  border-bottom: 2px solid #6f42c1;
  color: #6f42c1;
}

a.logo-link:focus,
a.logo-link:active {
  border-bottom: none;
}

/* ===== SEARCH SUGGESTIONS ===== */
#search-suggestions {
  position: absolute;
  background: #fff;
  z-index: 999;
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
}

.suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  color: #333;
}

.suggestion-item:hover {
  background: #f5f5f5;
  color: #6f42c1;
}

.suggestion-item.loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #6f42c1;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== HEADER: MAIN WRAPPER ===== */
.main-header {
  background: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 999;
}

/* ===== UNIFIED DESKTOP HEADER LINE ===== */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  flex-wrap: nowrap;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.swapdey-logo {
  height: 36px;
  width: auto;
  display: block;
}

.header-search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-search form {
  max-width: 600px;
  width: 100%;
  position: relative;
}

.header-search input[type="search"] {
  width: 100%;
  padding: 12px 44px 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #666;
  background: none;
  border: none;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  font-size: 18px;
}

/* ===== ICONS ===== */
.cart-link {
  position: relative;
}


.profile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f3f3;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.profile-dropdown {
  position: relative;
}


.profile-menu.show {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.profile-menu a {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-in-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #222;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

/* ===== TOP BAR & SUB NAVIGATION ===== */
.top-bar {
  background: #f6f6f6;
  padding: 8px 16px;
  width: 100%;
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-nav {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.top-nav li::marker {
  display: none;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-right a,
.top-right span {
  font-size: 14px;
  color: #333;
}

.sub-nav {
  background: #fff;
  padding: 10px 16px;
  overflow-x: auto;
}

.sub-nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===== RESPONSIVE / MEDIA QUERIES ===== */
@media (max-width: 768px) {
  .main-header,
  .top-bar,
  .sub-nav,
  .desktop-header-row {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-header-top,
  .mobile-header-bottom,
  .mobile-menu,
  .mobile-overlay,
  .mobile-toggle {
    display: none !important;
  }
}


/* ===== MOBILE MENU ===== */
.mobile-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0,0,0,0.2);
  z-index: 1000;
  padding: 20px;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
}

.mobile-menu.active {
  right: 0;
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 28px;
  align-self: flex-end;
  cursor: pointer;
  margin-bottom: 20px;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-list li {
  margin-bottom: 16px;
}

.mobile-menu-list a {
  font-size: 18px;
  color: #222;
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.mobile-menu-list a:hover {
  color: #00BFFF;
}

/* ===== MOBILE HEADER: TOP BAR ALIGNMENT ===== */
.mobile-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.mobile-logo svg {
  height: 36px;
}

/* Trade-in and Menu Icons */
.mobile-header-top .trade-in-btn {
  background: #f3f3f3;
  border: none;
  padding: 8px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-header-top .mobile-toggle {
  background: none;
  border: none;
  font-size: 24px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MOBILE HEADER: SEARCH BAR ===== */
.mobile-header-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.mobile-header-bottom .header-search {
  flex: 1;
  position: relative;
}

.mobile-header-bottom input[type="search"] {
  width: 100%;
  padding: 10px 42px 10px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

.mobile-header-bottom .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #666;
  background: none;
  border: none;
}

/* ===== ICONS (Cart and Profile) ===== */
.mobile-header-bottom .header-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-link,
.profile-icon {
  font-size: 18px;
  color: #222;
  background: #f3f3f3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}


.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: bold;
  line-height: 1;
}


/* Optional smooth slide-down for profile menu */
.profile-menu {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 1001;
  flex-direction: column;
  transform: translateY(-5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}



/* === Mobile Header User Role Link === */
.mobile-user-role {
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  color: #333;
  margin-top: 4px;
}

.mobile-user-role a {
  color: #333;
  text-decoration: none;
}

.mobile-user-role a:hover {
  color: #00BFFF;
}


.products.columns-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-link {
  display: block;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow 0.2s ease;
}

.product-link:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-image img {
  width: 100%;
  border-radius: 6px;
}

.product-price {
  font-weight: bold;
  font-size: 18px;
  margin: 8px 0;
}

.product-badges .badge {
  display: inline-block;
  background: #00bfa5;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 12px;
  margin-top: 6px;
}

.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #ddd;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.compare-bar.hidden {
  display: none;
}

.compare-btn {
  background: #00BFFF;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

#compare-items {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.clear-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  margin-left: 12px;
  cursor: pointer;
}

/* === Shop Page Styles === */
.swapdey-shop-container .shop-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}

.category-seo-block p {
  font-size: 16px;
  color: #444;
  line-height: 1.6;
}

.category-seo-block h2 {
  font-size: 20px;
  color: #111;
  margin-top: 20px;
}


/* === To make widgets pretty === */
.widget_layered_nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget_layered_nav li {
  margin-bottom: 8px;
}

.widget_layered_nav a {
  color: #0073aa;
  text-decoration: none;
  font-size: 14px;
}

.widget_layered_nav a:hover {
  text-decoration: underline;
}

.widget_layered_nav .count {
  float: right;
  color: #777;
}


/* === FILTER ACCORDION === */
@media (max-width: 768px) {
  .accordion-wrapper .widget {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .accordion-wrapper .widget-title {
    background: #f9f9f9;
    padding: 12px 16px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
  }

  .accordion-wrapper .widget ul {
    display: none;
    padding: 12px 16px;
  }

  .accordion-wrapper .widget.open ul {
    display: block;
  }
}

/* === SELECTED FILTER TAGS === */
.selected-filters .tag {
  display: inline-block;
  background: #eee;
  padding: 4px 10px;
  margin: 4px;
  border-radius: 20px;
  font-size: 13px;
}

.selected-filters .tag button {
  background: none;
  border: none;
  margin-left: 6px;
  cursor: pointer;
  font-weight: bold;
}


.filter-chip:hover {
  background: #e6e6e6;
}



.top-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 60px;
  background: white;
  z-index: 9;
  align-items: center; /* ✅ Prevent vertical stretching */
}

.filter-chip {
  background: #f2f2f2;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  display: inline-flex;         /* ✅ Prevent full height */
  align-items: center;          /* ✅ Center icon/text vertically */
  justify-content: center;
  height: auto;
}



/* === product hover effects === */
.product-tile {
  transition: all 0.3s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.product-tile:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Optional image zoom effect */
.product-tile a img {
  transition: transform 0.3s ease;
}

.product-tile:hover a img {
  transform: scale(1.05);
}

/* Fade-in CTA on hover */
.tile-cta {
  transition: opacity 0.3s ease;
  opacity: 0;
}

.product-tile:hover .tile-cta {
  opacity: 1;
}


/* Product Tile Font Adjustments */
.product-grid h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.products.columns-3 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-tile {
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
}


.product-grid .condition-badge {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 16px;
  background: #eee;
  display: inline-block;
  margin-bottom: 6px;
}

.product-grid .tile-cta .button {
  font-size: 14px;
  padding: 8px 12px;
}

/* Product Tile Compact Styling */
.product-tile {
  padding: 12px;
  font-size: 13px;
}

.product-tile h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
}


.product-tile .condition-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 12px;
  margin-bottom: 6px;
  display: inline-block;
}

.product-tile .expand-details {
  font-size: 11px;
  cursor: pointer;
  margin-bottom: 6px;
}

.product-tile .product-meta-details {
  font-size: 11px;
  color: #666;
}

.product-tile .tile-cta .button {
  font-size: 12px;
  padding: 6px 10px;
  margin-top: 8px;
}


.product-grid {
  gap: 16px;
}

/* === Star Rating Styling === */

.woocommerce .star-rating::before,
.woocommerce .star-rating span::before {
  color: #facc15;
}

/* === Color Dots === */
.color-dots {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}



/* === Price Formatting === */

.product-tile .price del {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  margin-right: 6px;
}

.product-tile .price ins {
  text-decoration: none;
  color: #111;
}

/* === Custom Vertical Price Stack === */
.custom-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.2;
}

.custom-price .sale-price {
  font-weight: 600;
  color: #111;
  font-size: 14px;
}

.custom-price .original-price {
  text-decoration: line-through;
  color: #888;
  font-size: 12px;
}

.custom-price .regular-price {
  font-weight: 500;
  font-size: 14px;
  color: #111;
}

/* === Product Star Ratings (Back Market Style) === */
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  margin-top: 6px;
}

.product-rating .star-rating {
  color: #f5a623; /* yellow stars */
  font-size: 13px;
  margin: 0;
  line-height: 1;
}

.product-rating .rating-text {
  font-size: 12px;
  color: #666;
}

/* === FINAL PRODUCT TILE TWEAKS (BACK MARKET STYLE) === */

.product-tile img {
  max-width: 100%;
  height: 140px;
  object-fit: contain;
  margin-bottom: 8px;
}


/* Adjust product title */
.product-grid h2,
.product-tile h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 4px;
  line-height: 1.3;
}

/* Price block spacing */
.custom-price {
  margin-top: 4px;
}

/* Rating alignment */
.star-rating {
  font-size: 13px;
  color: #f5a623;
  margin-bottom: 4px;
}

/* Color dots - Back Market style */
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #999;
  display: inline-block;
}


ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}


/* Responsive 2 columns on small devices */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}







@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

