/*
Theme Name: Amazonish
Theme URI: https://example.com/amazonish
Author: GitHub Copilot
Author URI: https://example.com
Description: WooCommerce-ready WordPress theme inspired by Amazon with a black top bar and search-first header.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: amazonish
Tags: ecommerce, wooCommerce, custom-background, custom-logo, featured-images, flexible-header, block-styles
*/

:root {
  --brand-black: #131921;
  --brand-blue: #232f3e;
  --brand-yellow: #febd69;
  --brand-white: #ffffff;
  --brand-grey: #f3f3f3;
  --brand-dark: #111;
  --border: #d5d9d9;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: #fafafa;
  color: var(--brand-dark);
}

a {
  color: #0071e3;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top-bar {
  background: var(--brand-black);
  color: var(--brand-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.top-bar .top-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-links-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.top-links-list li {
  margin: 0;
}

.top-links-list a {
  color: var(--brand-white);
  opacity: 0.9;
}

.top-bar a,
.top-bar span {
  color: var(--brand-white);
  opacity: 0.9;
}

.site-header {
  background: var(--brand-blue);
  color: var(--brand-white);
  padding: 0.75rem 1rem;
}

.primary-nav {
  background: var(--brand-white);
  border-bottom: 1px solid #e4e6eb;
  width: 100%;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 1300px;
  width: 100%;
}

.primary-menu > li {
  position: relative;
}

.primary-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 1rem 1rem;
  color: var(--brand-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.primary-menu li.menu-item-has-children > a::after {
  content: '▾';
  margin-left: 0.35rem;
  font-size: 0.75rem;
}

.primary-menu .sub-menu {
  display: none;
    position: fixed;
    left: 99vw;
    top: 34%;
    width: 100vw;
    margin-left: calc(0vw - 100%);
    background: #ffffff;
    padding: 1.5rem calc(50% - 640px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--brand-yellow);
    z-index: 50;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  display: grid;
}

.primary-menu .sub-menu {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
}

.primary-menu .sub-menu li {
  margin: 0;
  padding: 0;
}

.primary-menu .sub-menu li a {
  display: block;
  padding: 0.35rem 0;
  color: #333;
  font-weight: 600;
}

.primary-menu .sub-menu li a:hover {
  color: var(--brand-blue);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  max-width: 1300px;
  margin: 0 auto;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.site-logo,
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-white);
  font-weight: 700;
  font-size: 1.4rem;
}

.site-logo span {
  color: var(--brand-yellow);
}

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

.header-search {
  flex: 1;
  min-width: 220px;
}

.search-form {
  display: flex;
  background: var(--brand-white);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.search-category {
  background: #ebeef0;
  border: none;
  padding: 0.75rem 0.75rem;
  font-size: 0.95rem;
  min-width: 120px;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0.75rem 0.75rem;
  font-size: 1rem;
}

.search-input:focus,
.search-category:focus {
  outline: none;
}

.search-button {
  background: var(--brand-yellow);
  border: none;
  color: var(--brand-dark);
  padding: 0 1.2rem;
  font-size: 1rem;
  cursor: pointer;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 220px;
  justify-content: flex-end;
}

.header-actions a {
  color: var(--brand-white);
  font-size: 0.95rem;
}

.header-actions .cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.08);
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
}

.home-hero {
  width: 100%;
  margin: 2rem 0 0;
  padding: 2rem 0;
  background: #f7f3ff;
}

.hero-inner {
  max-width: 1300px;
  width: min(100%, 1300px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, #f7e8ff 0%, #fce6e6 100%);
  border-radius: 20px;
  padding: 2rem;
  min-height: 320px;
}

.hero-copy {
  flex: 1 1 320px;
  min-width: 280px;
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.hero-inner h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.hero-inner p {
  margin: 0 0 1.4rem;
  color: #333;
  line-height: 1.7;
  max-width: 540px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-yellow);
  color: var(--brand-dark);
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero-image {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 1rem;
  width: min(100%, 420px);
}

.hero-image-card {
  position: relative;
  min-height: 160px;
  border-radius: 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  padding: 1rem;
  color: var(--brand-dark);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.hero-image-card--left {
  background: linear-gradient(180deg, #ffffff 0%, #ffe6e5 100%);
}

.hero-image-card--right {
  background: linear-gradient(180deg, #ffffff 0%, #e8f5ff 100%);
}

.category-blocks {
  width: 100%;
  margin: 2rem 0 0;
  padding: 2rem 1rem 2.5rem;
  background: #f9fafb;
}

.section-heading {
  max-width: 1300px;
  margin: 0 auto 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.5rem;
}

.view-all-link {
  color: var(--brand-blue);
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.featured-category {
  width: 100%;
  margin: 2rem 0;
  padding: 2rem 1rem 2.5rem;
  background: #fff8ef;
}

.featured-category .section-heading {
  max-width: 1300px;
  margin: 0 auto 1rem;
}

.featured-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1300px;
  margin: 0 auto;
}

.featured-product-card {
  background: var(--brand-white);
  border: 1px solid #e4e6eb;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.product-image {
  display: block;
  width: 100%;
  min-height: 240px;
  background: #f6f7f8;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.product-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.product-title a {
  color: var(--brand-dark);
  text-decoration: none;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.product-button {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.category-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: var(--brand-white);
  border: 1px solid #e4e6eb;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.category-image {
  width: 100%;
  min-height: 180px;
  background: #f6f7f8;
  display: grid;
  place-items: center;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-image.fallback-image {
  padding: 1rem;
}

.category-image.fallback-image span {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: #333;
}

.category-details {
  padding: 1rem;
}

.category-details h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.category-details p {
  margin: 0;
  color: #5f6368;
  font-size: 0.95rem;
}

main.site-main {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.post-card {
  background: var(--brand-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
}

.post-card h2 {
  margin-top: 0;
}

.post-card p {
  line-height: 1.7;
}

.site-footer {
  background: #111;
  color: #c7c7c7;
  padding: 2rem 1rem;
}

.site-footer .footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

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

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .site-branding,
  .header-actions {
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
  }

  .primary-menu {
    flex-direction: column;
    gap: 0;
    padding: 0 1rem;
  }

  .primary-menu > li > a {
    padding: 0.85rem 0;
  }

  .primary-menu .sub-menu {
    position: static;
    width: auto;
    box-shadow: none;
    border-top: none;
    display: none;
    padding: 0;
    background: transparent;
    grid-template-columns: 1fr;
  }

  .primary-menu li:hover > .sub-menu,
  .primary-menu li:focus-within > .sub-menu {
    display: block;
  }
}

@media (max-width: 650px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    flex-direction: column;
  }

  .search-category,
  .search-input,
  .search-button {
    width: 100%;
    border-radius: 0;
  }

  .header-search {
    order: 3;
  }
}
