/* Logo Quality Improvements */

/* فقط برای صفحه قیمت */
.steel-price-page {
  background-color: #ffffff;
  font-family: 'PeydaWebFaNum', 'Peyda', 'IRANSans', sans-serif;
  direction: rtl;
  text-align: right;
  min-height: auto;
  padding-top: 20px;
  padding-bottom: 0;
}

.steel-price-page .price-container {
  max-width: 1376px;
  margin: 0 auto;
  padding: 20px;
  direction: rtl;
}

.steel-price-page .price-grid {
  display: grid;
  direction: rtl;
}

.steel-price-page .main-content-section {
  order: 1;
}

.steel-price-page .sidebar-section {
  order: 2;
  position: sticky;
  top: 120px;
  height: fit-content;
  direction: rtl;
}

@media (max-width: 768px) {
  .steel-price-page .price-grid {
  }
  .steel-price-page .sidebar-section {
    display: none;
  }
}

.steel-price-page .white-box {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f5f3f0;
}

.steel-price-page .filter-header {
  display: flex;
  align-items: center;
  padding: 16px;
}

.steel-price-page .filter-title {
  font-size: 18px;
  font-weight: 600;
  color: #514E46;
  margin-right: 8px;
  font-family: 'PeydaWebFaNum', sans-serif;
}

.steel-price-page .filter-section {
  border-bottom: 1px solid #F2ECE3;
  padding: 16px;
}

.steel-price-page .filter-section:last-child {
  border-bottom: none;
}

.steel-price-page .filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  direction: rtl;
  text-align: right;
}

.steel-price-page .filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #00AF9C;
  margin-left: 10px;
  margin-right: auto;
}

.steel-price-page .page-title-box {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f5f3f0;
}

.steel-price-page .page-title-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  direction: rtl;
}

.steel-price-page .page-title {
  font-size: 22px;
  font-weight: 600;
  color: #514E46;
  font-family: 'PeydaWebFaNum', sans-serif;
}

.steel-price-page .divider {
  width: 2px;
  height: 43px;
  background: #DED8CF;
}

.steel-price-page .product-count {
  font-size: 15px;
  color: #514E46;
}

.steel-price-page .action-buttons {
  margin-left: auto;
  margin-right: 0;
  display: flex;
  gap: 12px;
  direction: rtl;
}

.steel-price-page .btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  height: 40px;
  border: 1.5px solid #F2ECE3;
  border-radius: 8px;
  color: #514E46;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.steel-price-page .btn-action:hover {
  background: #F2ECE3;
}

.steel-price-page .quick-access {
  margin-top: 24px;
  position: relative;
  height: 56px;
  overflow: hidden;
  background: #F2ECE3;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.steel-price-page .quick-access-label {
  display: flex;
  align-items: center;
  border-left: 1px solid #DED8CF;
  height: 70%;
  padding: 0 20px;
}

.steel-price-page .quick-access-label-text {
  font-size: 18px;
  font-weight: 600;
  color: #514E46;
  margin-right: 8px;
}

.steel-price-page .quick-links {
  display: flex;
  gap: 8px;
  margin-right: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.steel-price-page .quick-links::-webkit-scrollbar {
  display: none;
}

.steel-price-page .quick-link {
  background: white;
  border: 1.5px solid #F2ECE3;
  border-radius: 24px;
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: #514E46;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.steel-price-page .price-table-box {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f5f3f0;
}

.steel-price-page .table-section {
  margin-bottom: 20px;
  background: white;
  border: 1.5px solid #DED8CF;
  border-radius: 12px;
  overflow: hidden;
}

.steel-price-page .table-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 10px;
  background: linear-gradient(to bottom, #ffffff 0%, #fdfbf8 100%);
  border-bottom: 1px solid #F2ECE3;
  direction: rtl;
  text-align: right;
}

.steel-price-page .table-title {
  font-size: 18px;
  font-weight: bold;
  color: #7F0031;
  font-family: 'PeydaWebFaNum', sans-serif;
}

.steel-price-page .table-divider {
  width: 1px;
  height: 20px;
  background: #00AF9C;
}

.steel-price-page .table-update {
  font-size: 16px;
  color: #AF0748;
  display: flex;
  align-items: center;
  gap: 5px;
}

.steel-price-page .table-update-date {
  color: #00AF9C;
  font-weight: bold;
}

.steel-price-page .price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  direction: rtl;
  text-align: center;
}

.steel-price-page .price-table thead {
  background: #F2ECE3;
}

.steel-price-page .price-table th {
  padding: 12px 8px;
  text-align: center;
  color: #514E46;
  font-weight: 500;
  font-size: 15px;
  font-family: 'PeydaWebFaNum', sans-serif;
  border-bottom: 2px solid #DED8CF;
}

.steel-price-page .price-table td {
  padding: 12px 8px;
  text-align: center;
  color: #464e5f;
  font-size: 15px;
  font-family: 'PeydaWebFaNum', sans-serif;
  border-bottom: 1px solid #f5f3f0;
}

.steel-price-page .price-table tbody tr:nth-child(even) {
  background: #FFFFFF;
}

.steel-price-page .price-table tbody tr:hover {
  background: #FFF9F0 !important;
  cursor: pointer;
}

.steel-price-page .price-table tbody tr:last-child td {
  border-bottom: none;
}

.steel-price-page .price-value {
  color: #35332E;
  font-weight: bold;
  font-size: 18px;
  font-family: 'PeydaWebFaNum', sans-serif;
  direction: ltr;
  display: inline-block;
}

.steel-price-page .price-change-positive {
  color: #1CA34E;
  direction: ltr;
  display: inline-block;
}

@media print {
  .hidePrint {
    display: none !important;
  }
}

/* Main logo styling - prevent blurriness and improve quality */
#Top_bar #logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    will-change: transform;
    filter: none;
    -webkit-filter: none;
    opacity: 1;
    visibility: visible;
}

/* Logo main state - desktop */
#Top_bar #logo img.logo-main {
    max-height: 70px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
}

/* Logo sticky state - when header is sticky */
#Top_bar.is-sticky #logo img.logo-sticky {
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
}

/* Logo mobile state */
@media only screen and (max-width: 768px) {
    #Top_bar #logo img.logo-mobile {
        max-height: 55px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
        object-position: center;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: auto;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    #Top_bar.is-sticky #logo img.logo-mobile-sticky {
        max-height: 50px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
        object-position: center;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: auto;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* Retina display support - improved quality */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min--moz-device-pixel-ratio: 2),
       only screen and (-o-min-device-pixel-ratio: 2/1),
       only screen and (min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi),
       only screen and (min-resolution: 2dppx) {
    
    #Top_bar #logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: auto;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

/* Prevent logo distortion on different screen sizes */
@media only screen and (max-width: 1240px) {
    #Top_bar #logo img {
        max-width: 200px;
    }
}

@media only screen and (max-width: 768px) {
    #Top_bar #logo img {
        max-width: 150px;
    }
}

@media only screen and (max-width: 480px) {
    #Top_bar #logo img {
        max-width: 120px;
    }
}

/* Ensure logo container maintains proper aspect ratio */
#Top_bar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

#Top_bar #logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fix for header stack layout */
.header-stack #Top_bar .logo #logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for creative header */
#Header_creative #Top_bar .logo #logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Additional quality improvements */
#Top_bar #logo img {
    filter: none;
    -webkit-filter: none;
    opacity: 1;
    visibility: visible;
    /* Force hardware acceleration for better rendering */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    /* Prevent subpixel rendering issues */
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

/* Smooth transitions for logo state changes */
#Top_bar #logo img.logo-main,
#Top_bar #logo img.logo-sticky,
#Top_bar #logo img.logo-mobile,
#Top_bar #logo img.logo-mobile-sticky {
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

/* Specific improvements for sticky state */
#Top_bar.is-sticky #logo img.logo-sticky {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: auto;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Ensure proper display states */
#Top_bar #logo img.logo-sticky {
    display: none;
}

#Top_bar.is-sticky #logo img.logo-main {
    display: none;
}

#Top_bar.is-sticky #logo img.logo-sticky {
    display: inline-block;
}

@media only screen and (max-width: 768px) {
    #Top_bar #logo img.logo-main,
    #Top_bar #logo img.logo-sticky {
        display: none !important;
    }
    
    #Top_bar #logo img.logo-mobile {
        display: inline-block !important;
    }
    
    #Top_bar.is-sticky #logo img.logo-mobile {
        display: none !important;
    }
    
    #Top_bar.is-sticky #logo img.logo-mobile-sticky {
        display: inline-block !important;
    }
    
/* اضافی: مطمئن شویم که فقط یک لوگو نمایش داده شود */
    #Top_bar #logo img.logo-mobile-sticky {
        display: none !important;
    }
}

/* اضافی: اطمینان از نمایش صحیح لوگوها */
@media only screen and (max-width: 768px) {
    #Top_bar #logo img {
        display: none !important;
    }
    
    #Top_bar #logo img.logo-mobile {
        display: inline-block !important;
    }
    
    #Top_bar.is-sticky #logo img.logo-mobile {
        display: none !important;
    }
    
    #Top_bar.is-sticky #logo img.logo-mobile-sticky {
        display: inline-block !important;
    }
}

/* Fix for category cards clickability and centering */
.products.tadaaaab {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    list-style: none !important;
}

.products.tadaaaab li {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 200px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

.products.tadaaaab li a {
    display: block !important;
    text-decoration: none !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 15 !important;
    pointer-events: auto !important;
}

.products.tadaaaab li a:hover {
    transform: translateY(-2px) !important;
    transition: transform 0.3s ease !important;
}

.products.tadaaaab li a div {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Desktop centering */
@media screen and (min-width: 769px) {
    .products.tadaaaab {
        justify-content: center !important;
        max-width: 1920px !important;
        margin: 0 auto !important;
    }
    
    .products.tadaaaab li {
        flex: 0 0 calc(25% - 20px) !important;
        max-width: 220px !important;
    }
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .products.tadaaaab {
        justify-content: center !important;
        gap: 15px !important;
    }
    
    .products.tadaaaab li {
        flex: 0 0 calc(50% - 10px) !important;
        max-width: 180px !important;
    }
}

/* High DPI display fixes */
@media only screen and (min-resolution: 144dpi) {
    #Top_bar #logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: auto;
    }
}

/* Additional fixes for logo quality */
#Top_bar .logo {
    position: relative;
    z-index: 10;
}

#Top_bar #logo {
    position: relative;
    z-index: 11;
}

/* Prevent logo from being affected by other CSS */
#Top_bar #logo img {
    position: relative;
    z-index: 12;
    isolation: isolate;
}

/* Force repaint for better quality */
#Top_bar #logo img:hover {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}
