/* ============================================================
   Amazon Clone — Responsive Stylesheet
   style.css
   Breakpoints:
     Desktop   : > 1024px  (default styles)
     Tablet    : ≤ 1024px
     Mobile    : ≤ 768px
     Mobile-SM : ≤ 480px
   ============================================================ */

/* ── RESET ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;   /* fixed: was "border:border-box" in original */
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ── NAVBAR ──────────────────────────────────────────────────── */
.navbar {
  height: 60px;
  background-color: #0f1111;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

/* ── Logo ── */
.nav-logo {
  flex-shrink: 0;
  height: 50px;
  width: 100px;
}

.logo {
  background-image: url("amazon_logo.png");
  background-size: cover;
  background-repeat: no-repeat;
  height: 50px;
  width: 100%;
}

/* ── Border hover ── */
.border {
  border: 1.5px solid transparent;
  border-radius: 2px;
  padding: 4px 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.border:hover {
  border-color: white;
}

/* ── Deliver address ── */
.nav-address {
  flex-shrink: 0;
}

.add-first {
  font-size: 0.75rem;
  color: #ccc;
}

.add-icon {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
}

.add-sec {
  font-size: 0.9rem;
}

/* ── Search bar ── */
.nav-search {
  flex: 1;
  display: flex;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  max-width: 700px;
  min-width: 0; /* allows shrinking */
}

.nav-search:focus-within {
  outline: 2px solid orange;
}

.search-select {
  background-color: #f3f3f3;
  width: 54px;
  min-width: 54px;
  text-align: center;
  border: none;
  border-right: 1px solid #cdcdcd;
  cursor: pointer;
  font-size: 0.8rem;
}

.search-input {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  border: none;
  padding: 0 0.5rem;
  outline: none;
}

.search-icon {
  width: 45px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  background-color: #febd68;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

.search-icon:hover {
  background-color: #f3a847;
}

/* ── Sign in / Returns ── */
.nav-signin,
.nav-return {
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-signin span,
.nav-return span {
  font-size: 0.7rem;
}

.nav-second {
  font-size: 0.85rem;
  font-weight: 700;
}

/* ── Cart ── */
.nav-cart {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-cart i {
  font-size: 1.6rem;
}

/* ── Hamburger (hidden on desktop) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

/* ── Mobile dropdown menu (hidden by default) ── */
.mobile-menu {
  display: none;
  background-color: #1a1a2e;
  color: white;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu-inner {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-inner a {
  color: #ddd;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.mobile-menu-inner a:hover {
  color: white;
}

.mobile-menu-section {
  font-weight: 700;
  font-size: 0.8rem;
  color: #aaa;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

/* ── PANEL ───────────────────────────────────────────────────── */
.panel {
  height: 40px;
  background-color: #333f3d;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.5rem;
  overflow: hidden;
}

.panel-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1.5px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
}

.panel-all:hover {
  border-color: white;
}

.panel-ops {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  overflow: hidden;
  flex-wrap: nowrap;
}

.panel-ops p {
  white-space: nowrap;
  padding: 4px 10px;
  border: 1.5px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}

.panel-ops p:hover {
  border-color: white;
}

.panel-deals {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 4px 8px;
  border: 1.5px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}

.panel-deals:hover {
  border-color: white;
}

/* ── HERO SECTION ────────────────────────────────────────────── */
.hero-section {
  background-image: url("hero_image.jpg");
  height: 350px;
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 25px;
}

.hero-msg {
  background-color: white;
  color: black;
  width: 80%;
  max-width: 900px;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  border-radius: 2px;
}

.hero-msg a {
  color: #007185;
}

.hero-msg a:hover {
  text-decoration: underline;
  color: #c45500;
}

/* ── SHOP SECTION ────────────────────────────────────────────── */
.shop-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 10px;
  background-color: #e2e7e6;
  padding: 10px;
}

.box {
  width: calc(25% - 16px);  /* 4 columns desktop */
  background-color: white;
  padding: 20px 0 15px;
}

.box-content {
  padding: 0 1rem;
}

.box-content h2 {
  font-size: 1rem;
}

.box-content p {
  color: #007185;
  font-size: 0.9rem;
  cursor: pointer;
}

.box-content p:hover {
  text-decoration: underline;
  color: #c45500;
}

/* ── Box background images — moved from inline HTML ── */
.box-img {
  height: 280px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0.75rem 0;
}

.box-img--1 { background-image: url("box1_image.jpg"); }
.box-img--2 { background-image: url("box2_image.jpg"); }
.box-img--3 { background-image: url("box3_image.jpg"); }
.box-img--4 { background-image: url("box4_image.jpg"); }
.box-img--5 { background-image: url("box5_image.jpg"); }
.box-img--6 { background-image: url("box6_image.jpg"); }
.box-img--7 { background-image: url("box7_image.jpg"); }
.box-img--8 { background-image: url("box8_image.jpg"); }

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  margin-top: 15px;
}

.foot-panel1 {
  background-color: #37475a;
  color: white;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85rem;
  cursor: pointer;
}

.foot-panel1:hover {
  background-color: #3d5166;
}

.foot-panel2 {
  background-color: #222f3d;
  color: white;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

.foot-panel2 ul {
  min-width: 140px;
}

.foot-heading {
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  margin-bottom: 0.75rem;
}

.foot-panel2 li a {
  display: block;
  font-size: 0.82rem;
  color: #dddddd;
  padding: 3px 0;
}

.foot-panel2 li a:hover {
  text-decoration: underline;
}

.foot-panel3 {
  background-color: #222f3d;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.foot-panel4 {
  background-color: #0f1111;
  color: white;
  padding: 1.25rem 1rem;
}

.pages {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.72rem;
}

.pages a {
  color: #ddd;
}

.pages a:hover {
  text-decoration: underline;
}

.copyright {
  font-size: 0.72rem;
  text-align: center;
  margin-top: 0.5rem;
  color: #aaa;
}


/* ============================================================
   MEDIA QUERIES
   ============================================================ */

/* ── TABLET — ≤ 1024px ───────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav: hide returns, shrink spacing */
  .nav-return {
    display: none;
  }

  .navbar {
    gap: 0.4rem;
  }

  /* Search: constrain max-width */
  .nav-search {
    max-width: 480px;
  }

  /* Panel: hide less-important links */
  .panel-ops p:nth-child(n+4) {
    display: none;
  }

  /* Shop: 2 columns */
  .box {
    width: calc(50% - 16px);
  }

  /* Box image shorter on tablet */
  .box-img {
    height: 240px;
  }

  /* Footer: 2 columns */
  .foot-panel2 ul {
    width: calc(50% - 2rem);
  }
}

/* ── MOBILE — ≤ 768px ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── Navbar ── */
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    position: relative;
  }

  /* Row 1: logo + hamburger */
  .nav-logo {
    order: 1;
  }

  .hamburger {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  /* Row 2: search takes full width */
  .nav-search {
    order: 3;
    max-width: 100%;
    width: 100%;
    flex-basis: 100%;
  }

  /* Hide these on mobile — moved to mobile menu */
  .nav-address,
  .nav-signin,
  .nav-return {
    display: none;
  }

  /* Cart stays visible */
  .nav-cart {
    order: 2;
    margin-left: 0;
  }

  .cart-label {
    display: none; /* just show icon on small screens */
  }

  /* ── Panel: hide ops & deals ── */
  .panel-ops,
  .panel-deals {
    display: none;
  }

  .panel {
    justify-content: flex-start;
  }

  /* ── Hero ── */
  .hero-section {
    height: 220px;
    padding-bottom: 15px;
  }

  .hero-msg {
    width: 95%;
    font-size: 0.78rem;
  }

  /* ── Shop: 2 columns ── */
  .box {
    width: calc(50% - 12px);
  }

  .box-img {
    height: 200px;
  }

  .box-content h2 {
    font-size: 0.9rem;
  }

  /* ── Footer: stack to 2 columns ── */
  .foot-panel2 {
    justify-content: flex-start;
    gap: 1.25rem;
  }

  .foot-panel2 ul {
    width: calc(50% - 1.5rem);
  }
}

/* ── MOBILE-SM — ≤ 480px ─────────────────────────────────────── */
@media (max-width: 480px) {
  /* ── Navbar ── */
  .nav-logo {
    width: 80px;
  }

  .logo {
    background-size: contain;
  }

  .search-select {
    display: none; /* hide category dropdown on tiny screens */
  }

  .search-input {
    border-radius: 4px 0 0 4px;
  }

  /* ── Hero ── */
  .hero-section {
    height: 160px;
    padding-bottom: 10px;
  }

  .hero-msg {
    width: 100%;
    border-radius: 0;
    font-size: 0.72rem;
    padding: 0.5rem;
  }

  /* ── Shop: 1 column ── */
  .box {
    width: 100%;
  }

  .box-img {
    height: 220px;
  }

  .box-content h2 {
    font-size: 1rem;
  }

  /* ── Footer: 1 column ── */
  .foot-panel2 ul {
    width: 100%;
  }

  .pages {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  .foot-panel1 {
    font-size: 0.8rem;
  }
}

/* ── MOBILE-XS — ≤ 360px ─────────────────────────────────────── */
@media (max-width: 360px) {
  .navbar {
    padding: 0.4rem 0.5rem;
  }

  .nav-logo {
    width: 70px;
  }

  .hero-section {
    height: 130px;
  }

  .box {
    width: 100%;
    padding: 12px 0 10px;
  }

  .box-img {
    height: 180px;
  }
}
