:root {
  --primary-color: #ed9c61;
  --bg-color: #fff4ec;
  --text-color: #523825;
  --heading-color: #4a3320;
  --text-muted: #a6988d;
  --surface-color: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #fffcf9;
  color: var(--text-color);
  min-height: 100vh;
}

main {
  padding: 30px 5% 60px;
}

.page-title {
  font-size: 2.3rem;
  color: var(--heading-color);
  font-weight: 800;
  margin-bottom: 10px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.page-card {
  background: var(--surface-color);
  border: 1px solid #f5e7dc;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: 24px;
  animation: fadeUp 0.7s ease both;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-color);
  padding: 15px 5%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-circle {
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  width: 35px;
  height: 55px;
}

.brand-text {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 35px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  bottom: -5px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(239, 160, 102, 0.3);
}

.profile-icon {
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.profile-icon:hover {
  transform: scale(1.08);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1001;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background-color: var(--primary-color);
  transition: 0.3s ease;
}

/* Product Page */
.product-shell {
  animation: fadeUp 0.7s ease both;
}

.search-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 14px;
  margin-bottom: 24px;
}

.search-container select,
.search-container input {
  width: 100%;
  border: 2px solid #f0e6dd;
  border-radius: 30px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-color);
  background: #fff;
}

.search-container select:focus,
.search-container input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(239, 160, 102, 0.15);
}

.autocomplete-wrapper {
  position: relative;
}

.suggestions-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #f3e3d8;
  border-radius: 15px;
  z-index: 99;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.suggestions-list li {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 10px;
}

.suggestions-list li:hover {
  background-color: var(--bg-color);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background-color: #fff;
  border: 1px solid #f4e4d9;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.6s ease both;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.product-image-wrap {
  background: #fff7f1;
  padding: 16px;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: transparent;
}

.product-details {
  padding: 16px 18px 18px;
}

.product-title {
  font-size: 1.1rem;
  color: var(--heading-color);
  font-weight: 700;
  margin-bottom: 6px;
}

.product-category {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.product-price {
  color: var(--primary-color);
  font-weight: 800;
}

/* Product Detail */
.detail-layout {
  max-width: 1200px;
  margin: 20px auto 50px;
  padding: 0 5%;
}

.detail-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  align-items: start;
}

.detail-image-container,
.detail-info {
  background: #fff;
  border: 1px solid #f4e4d9;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  animation: fadeUp 0.7s ease both;
}

.detail-image-container img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.category-badge {
  display: inline-block;
  background: var(--bg-color);
  color: var(--primary-color);
  border: 1px solid #f1d7c2;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

#detail-name {
  font-size: 2rem;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.price-tag {
  font-size: 1.8rem;
  color: var(--primary-color);
  font-weight: 800;
  margin-bottom: 10px;
}

#detail-stock {
  margin-bottom: 16px;
  font-weight: 700;
}

.quantity-controls {
  display: inline-flex;
  border: 2px solid #f1e5dd;
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 16px;
}

.quantity-controls button,
#qty-input {
  height: 44px;
  width: 50px;
  border: none;
  background: #fff;
  text-align: center;
  font-size: 1.1rem;
}

.quantity-controls button {
  cursor: pointer;
  color: var(--heading-color);
  font-weight: 800;
}

.quantity-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#qty-input {
  width: 60px;
  color: var(--heading-color);
  font-weight: 700;
}

#add-to-cart {
  display: block;
  margin-bottom: 24px;
  background: var(--primary-color);
  color: #fff;
  border: 2px solid var(--primary-color);
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

#add-to-cart:hover:not(:disabled) {
  background: #fff;
  color: var(--primary-color);
}

#add-to-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-info h3 {
  color: var(--heading-color);
  margin-bottom: 8px;
}

#detail-description {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Cart */
.cart-shell {
  animation: fadeUp 0.7s ease both;
}

.cart-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

#cart-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

#cart-table th,
#cart-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f0e4da;
  text-align: left;
}

#cart-table th {
  color: var(--heading-color);
  background-color: #fff8f3;
  font-weight: 700;
}

.cart-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.remove-btn {
  color: #fff;
  background: #cb5b5b;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.cart-total {
  text-align: right;
  font-size: 1.3rem;
  margin-top: 18px;
  font-weight: bold;
  color: var(--heading-color);
}

.checkout-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 11px 22px;
  border: 2px solid var(--primary-color);
  border-radius: 28px;
  cursor: pointer;
  font-size: 1rem;
  float: right;
  margin-top: 10px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  background: #fff;
  color: var(--primary-color);
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.empty-msg h2 {
  color: var(--heading-color);
  margin-bottom: 10px;
}

.empty-msg a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}

/* Profile */
.profile-shell {
  max-width: 540px;
  margin: 30px auto 40px;
  padding: 0 5%;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form .input-group {
  display: grid;
  gap: 7px;
}

.profile-form label {
  font-size: 0.9rem;
  color: var(--heading-color);
  font-weight: 600;
}

.profile-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #f0e6dd;
  border-radius: 30px;
  background: #fff;
  color: var(--text-color);
}

.profile-form input:disabled {
  background: #f8f5f2;
  color: #8f8175;
}

.profile-buttons,
.profile-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.profile-btn {
  border: 2px solid transparent;
  border-radius: 30px;
  padding: 11px 16px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-btn:hover {
  transform: translateY(-2px);
}

.profile-btn.edit {
  background: #28a745;
}

.profile-btn.save {
  background: #007bff;
}

.profile-btn.cancel {
  background: #6c757d;
}

.profile-btn.logout {
  background: #cb5b5b;
}

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  background-color: var(--heading-color);
  color: #fffcf9;
  padding-top: 70px;
  margin-top: 50px;
}

.footer-container {
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 5%;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-col {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards;
}

.footer-brand {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #fffcf9;
}

.footer-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: #fffcf9;
}

.footer-desc {
  color: #d1c8c1;
  line-height: 1.6;
  margin-bottom: 25px;
  font-size: 1rem;
  max-width: 90%;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border: 2px solid #fffcf9;
  border-radius: 50%;
  color: #fffcf9;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-5px);
}

.footer-links,
.footer-text-list {
  list-style: none;
}

.footer-links li,
.footer-text-list li {
  margin-bottom: 15px;
}

.footer-links a {
  color: #d1c8c1;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.footer-text-list li {
  color: #d1c8c1;
  line-height: 1.5;
}

.footer-bottom {
  text-align: center;
  padding: 25px 0;
  margin-top: 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: #8a7a6c;
  font-size: 0.95rem;
}

/* SweetAlert Theme */
.vetline-popup {
  border-radius: 22px !important;
  border: 1px solid #f5dfcf !important;
  box-shadow: 0 18px 40px rgba(82, 56, 37, 0.14) !important;
}

.vetline-title {
  color: var(--heading-color) !important;
  font-weight: 800 !important;
}

.vetline-text {
  color: var(--text-muted) !important;
}

.vetline-confirm,
.vetline-cancel {
  border-radius: 28px !important;
  padding: 10px 20px !important;
  font-weight: 700 !important;
  border: 2px solid transparent !important;
}

.vetline-confirm {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}

.vetline-cancel {
  background: #fff !important;
  color: var(--heading-color) !important;
  border-color: #e6d3c4 !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .search-container {
    grid-template-columns: 1fr 1fr;
  }

  .detail-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: -100%;
    width: 100%;
    background-color: var(--bg-color);
    flex-direction: column;
    text-align: center;
    gap: 0;
    transition: 0.4s ease-in-out;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    padding: 18px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 40px 25px;
  }
}

@media (max-width: 600px) {
  .brand-text {
    font-size: 1.1rem;
  }

  .logo-circle,
  .profile-icon {
    width: 35px;
    height: 35px;
  }

  .profile-icon svg {
    width: 20px;
    height: 20px;
  }

  .cart-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .nav-right {
    gap: 8px;
  }

  .search-container {
    grid-template-columns: 1fr;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

/* Responsive by device ranges */

@media (min-width: 1025px) and (max-width: 1200px) {
  .page-title {
    font-size: 2.1rem;
  }

  .search-container {
    grid-template-columns: 1fr 1fr 1fr 1.6fr;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-layout {
    max-width: 1100px;
  }

  .detail-container {
    gap: 22px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  main {
    padding: 24px 4% 48px;
  }

  .page-title {
    font-size: 2rem;
  }

  .search-container {
    grid-template-columns: 1fr 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-image-wrap {
    min-height: 200px;
  }

  .product-image {
    height: 170px;
  }

  .detail-layout {
    padding: 0 4%;
    margin: 16px auto 36px;
  }

  .detail-container {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #detail-name {
    font-size: 1.7rem;
  }

  .price-tag {
    font-size: 1.5rem;
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .navbar {
    padding: 12px 4%;
  }

  .brand-text {
    font-size: 1.18rem;
  }

  .logo-circle,
  .profile-icon {
    width: 42px;
    height: 42px;
  }

  .cart-btn {
    padding: 7px 14px;
    font-size: 0.9rem;
  }

  main {
    padding: 20px 14px 38px;
  }

  .page-card {
    padding: 18px;
    border-radius: 18px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .search-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .product-image-wrap {
    min-height: 170px;
    padding: 12px;
  }

  .product-image {
    height: 145px;
  }

  .product-details {
    padding: 12px;
  }

  .detail-layout {
    margin: 12px auto 30px;
    padding: 0 14px;
  }

  .detail-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .detail-image-container,
  .detail-info {
    padding: 16px;
    border-radius: 18px;
  }

  #detail-name {
    font-size: 1.5rem;
  }

  .price-tag {
    font-size: 1.35rem;
  }

  .quantity-controls button,
  #qty-input {
    width: 46px;
    height: 40px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

@media (min-width: 320px) and (max-width: 480px) {
  .navbar {
    padding: 10px 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .logo-circle,
  .profile-icon {
    width: 34px;
    height: 34px;
  }

  .logo-img {
    width: 24px;
    height: 34px;
  }

  .profile-icon svg {
    width: 18px;
    height: 18px;
  }

  .cart-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .cart-btn svg {
    width: 15px;
    height: 15px;
  }

  .nav-right {
    gap: 6px;
  }

  main {
    padding: 16px 10px 28px;
  }

  .page-card {
    padding: 14px;
    border-radius: 16px;
  }

  .page-title {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 14px;
  }

  .search-container {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .search-container select,
  .search-container input {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-image-wrap {
    min-height: 150px;
    padding: 10px;
  }

  .product-image {
    height: 132px;
  }

  .product-title {
    font-size: 1rem;
  }

  .detail-layout {
    margin: 8px auto 22px;
    padding: 0 10px;
  }

  .detail-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-image-container,
  .detail-info {
    padding: 12px;
    border-radius: 14px;
  }

  #detail-name {
    font-size: 1.25rem;
    margin-bottom: 6px;
  }

  .price-tag {
    font-size: 1.15rem;
    margin-bottom: 8px;
  }

  #add-to-cart {
    width: 100%;
    margin-top: 2px;
    margin-bottom: 16px;
  }

  .quantity-controls {
    width: 100%;
    justify-content: center;
  }

  .quantity-controls button,
  #qty-input {
    width: 44px;
    height: 38px;
    font-size: 1rem;
  }

  .cart-total {
    font-size: 1.1rem;
  }

  .checkout-btn {
    width: 100%;
    float: none;
  }

  .footer {
    margin-top: 30px;
    padding-top: 46px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
  }

  .footer-brand {
    font-size: 1.5rem;
  }

  .social-links {
    justify-content: center;
  }
}
