@import url('https://fonts.googleapis.com/css2?family=Changa:wght@400;500;600;700;800&display=swap');

* {
  box-sizing: border-box;
  font-family: 'Changa', Arial, sans-serif !important;
}

body {
  margin: 0;
  direction: rtl;
  color: #fff;
  background: radial-gradient(circle at top, #12356d 0%, #07152f 45%, #030814 100%);
}

.top {
  text-align: center;
  padding: 34px 16px 26px;
  background: linear-gradient(135deg, #07152f, #12356d);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.top h1 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 800;
}

.top p,
.top a {
  color: #dbe7ff !important;
}

.catalog-logo {
  width: 240px;
  max-width: 80%;
  display: block;
  margin: 0 auto 12px;
  object-fit: contain;
}

.main-site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  padding: 12px 24px;
  background: linear-gradient(135deg,#e31b23,#ff4a4a);
  color: #fff !important;
  text-decoration: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  transition: .3s;
  box-shadow: 0 8px 20px rgba(227,27,35,.35);
}

.main-site-btn:hover {
  transform: translateY(-2px);
}

.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 26px 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  background: #fff;
  display: block;
}

.product-card img,
.product-img,
.product-popup-img {
  cursor: pointer;
}

.card-body {
  padding: 12px;
}

.card h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.4;
}

.product-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  height: 44px;
  overflow: hidden;
}

.card p {
  color: #dbe7ff;
  font-size: 13px;
  line-height: 1.6;
  height: 42px;
  overflow: hidden;
  margin: 0 0 8px;
}

.price-box {
  margin: 10px 0 12px;
  background: rgba(3, 8, 20, .45);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 8px 10px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.4;
}

.price-line:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.price-line span {
  color: #cfd8ea;
  font-weight: 700;
}

.price-line strong {
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  direction: ltr;
}

.price-usd strong {
  color: #42d77d;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #e31b23, #ff4a4a);
  color: #fff !important;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn2 {
  background: #12356d;
}

.admin-box {
  max-width: 420px;
  margin: 70px auto;
  background: rgba(255,255,255,.09);
  padding: 25px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  margin: 7px 0 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #111;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: right;
}

.small-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

.actions a {
  margin-left: 8px;
  color: #e31b23;
}

/* Home Banner - 1920x700 */
.home-banners {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

.home-banners a,
.banner-link {
  display: block;
  text-decoration: none;
}

.home-banners img {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 1920 / 700;
  object-fit: contain !important;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,.25);
  transition: .25s;
}

.banner-link:hover img {
  transform: scale(1.01);
}

/* Popup */
.image-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.86);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-popup.active {
  display: flex;
}

.image-popup img {
  max-width: 95%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}

.image-popup-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 30px;
  cursor: pointer;
  z-index: 100000;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 15px;
}

.breadcrumb a {
  color: #ffffff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  transition: .3s;
}

.breadcrumb a:hover {
  background: rgba(255,255,255,.18);
}

.breadcrumb span {
  color: #dbe7ff;
}

/* Admin Nav */
.admin-nav {
  background: rgba(3, 8, 20, .92);
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.admin-nav-title {
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}

.admin-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  font-size: 14px;
  font-weight: 600;
}

.admin-nav-links a:hover {
  background: linear-gradient(135deg, #e31b23, #ff4a4a);
}

.admin-nav-links .logout-link {
  background: #e31b23;
}

/* Icons */
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 3px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 17px;
  background: #f3f4f6;
}

.edit-icon {
  color: #0b63ce !important;
}

.delete-icon {
  color: #e31b23 !important;
}

/* Dashboard Cards */
.dashboard-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(170px,1fr));
  gap: 14px;
  margin-top: 20px;
}

.dashboard-product-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.dashboard-product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #f5f5f5;
}

.dashboard-product-body {
  padding: 10px;
}

.dashboard-product-body h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #111;
  line-height: 1.4;
  height: 36px;
  overflow: hidden;
}

.dashboard-product-category {
  color: #666;
  font-size: 12px;
  margin-bottom: 8px;
}

.dashboard-product-clicks {
  display: inline-block;
  background: #e31b23;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* Products Admin Search */
.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.add-product-btn {
  width: auto !important;
}

.product-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.product-search-form input {
  width: 260px;
  margin: 0;
}

.product-search-form .btn {
  width: auto;
  white-space: nowrap;
}

.clear-search {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,.12);
  padding: 9px 14px;
  border-radius: 12px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.pagination a {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.10);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
}

.pagination a.active {
  background: linear-gradient(135deg,#e31b23,#ff4a4a);
}

/* Responsive */
@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .top {
    padding: 18px 16px 8px;
  }

  .top p {
    display: none;
  }

  .top h1 {
    margin-bottom: 4px;
    font-size: 24px;
  }

  .catalog-logo {
    width: 140px;
    max-width: 70%;
    margin-bottom: 6px;
  }

  .main-site-btn {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
    display: flex;
    font-size: 15px;
    padding: 11px 18px;
  }

  .home-banners {
    margin: 10px auto 15px !important;
    padding: 0 10px;
  }

  .home-banners img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 1920 / 700;
    object-fit: contain !important;
    border-radius: 14px;
  }

  .wrap {
    padding: 10px 10px 85px !important;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card {
    border-radius: 16px;
  }

  .card-body {
    padding: 8px;
  }

  .product-card h3 {
    font-size: 14px;
    height: 40px;
    margin-bottom: 4px;
  }

  .card p {
    font-size: 11px;
    line-height: 1.5;
    height: 34px;
    margin-bottom: 6px;
  }

  .price-box {
    padding: 6px 8px;
    margin: 8px 0;
  }

  .price-line {
    font-size: 12px;
    padding: 3px 0;
  }

  .price-line strong {
    font-size: 14px;
  }

  .btn {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 12px;
  }

  .breadcrumb {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 8px 12px;
    margin: 14px auto 0;
    max-width: 100%;
    scrollbar-width: none;
  }

  .breadcrumb::-webkit-scrollbar {
    display: none;
  }

  .breadcrumb a,
  .breadcrumb span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .breadcrumb a {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
  }

  .breadcrumb span {
    font-size: 13px;
    color: #ffd34d;
  }

  .image-popup img {
    max-width: 100%;
    max-height: 80vh;
  }

  .image-popup-close {
    top: 12px;
    right: 12px;
  }

  .admin-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-nav-links a {
    text-align: center;
    padding: 10px 8px;
  }

  .dashboard-products-grid {
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
  }

  .products-toolbar {
    display: block;
  }

  .add-product-btn {
    width: 100% !important;
    margin-bottom: 12px;
  }

  .product-search-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .product-search-form input {
    width: 100%;
  }

  .clear-search {
    display: block;
    text-align: center;
    margin-top: 8px;
    grid-column: 1 / -1;
  }
}