/* ==========================================================================
   12. PRODUCT COMPARISON FEATURE STYLING
   ========================================================================== */

/* Active Compare & Wishlist Button Indicator */
.js-compare.active,
.js-wishlist.active {
  color: #ce1118 !important;
}

.js-compare.active .material-symbols-outlined,
.js-wishlist.active .material-symbols-outlined {
  color: #ce1118 !important;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

/* Compare Button Loading State */
.js-compare.loading {
  pointer-events: none;
  opacity: 0.6;
}

.js-compare.loading .material-symbols-outlined {
  animation: stcRotate 1s linear infinite;
}

@keyframes stcRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Bottom Compare Bar (Drawer) */
#stc-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
  z-index: 1040;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.75rem 0;
}

#stc-compare-bar.open {
  transform: translateY(0);
}

/* Mobile Default styles for stc-compare-bar-container */
.stc-compare-bar-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

.stc-compare-items-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.stc-compare-items-list::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.stc-compare-bar-item {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 4px 8px 4px 6px;
  flex: 0 0 auto;
  max-width: 150px;
  gap: 4px;
  animation: stcFadeIn 0.3s ease;
}

.stc-compare-bar-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.stc-compare-bar-item .item-title {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.stc-compare-bar-item .remove-item-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ce1118;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(206, 17, 24, 0.3);
  transition: transform 0.2s;
  padding: 0;
  line-height: 1;
}

.stc-compare-bar-item .remove-item-btn:hover {
  transform: scale(1.15);
}

.stc-compare-bar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.stc-btn-compare-now {
  background: #ce1118;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(206, 17, 24, 0.2);
  transition: all 0.3s ease;
}

.stc-btn-compare-now:hover {
  background: #e3121b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(206, 17, 24, 0.35);
}

.stc-btn-compare-clear {
  background: none;
  border: none;
  color: #666;
  font-weight: 600;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}

.stc-btn-compare-clear:hover {
  color: #ce1118;
}

@keyframes stcFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Compare Modal Dialog */
#stc-compare-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1060;
  display: none;
  align-items: center;
  justify-content: center;
}

#stc-compare-modal.show {
  display: flex;
}

.stc-compare-modal-content {
  background: #fff;
  width: 96%;
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: stcModalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stcModalSlide {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.stc-compare-modal-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stc-compare-modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.stc-compare-modal-close {
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.stc-compare-modal-close:hover {
  background: #ce1118;
  color: #fff;
}

.stc-compare-modal-body {
  padding: 1rem;
  overflow: auto;
  flex: 1;
}

/* Compare Grid Table Styling */
.stc-compare-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
}

.stc-compare-table th,
.stc-compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.stc-compare-table th {
  font-weight: 700;
  color: #666;
  font-size: 11px;
  text-transform: uppercase;
  background: #fbfbfb;
  width: 100px;
  min-width: 90px;
}

.stc-compare-table td {
  font-size: 12px;
  color: #444;
  min-width: 140px;
}

.stc-compare-table tr:first-child th,
.stc-compare-table tr:first-child td {
  background: none !important;
  border-bottom: 2px solid #e0e0e0;
}

/* Header Cells (Product info block) */
.stc-compare-header-cell {
  position: relative;
  text-align: center;
  padding: 1rem 0.5rem !important;
}

.stc-compare-header-cell .remove-column-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.stc-compare-header-cell .remove-column-btn:hover {
  color: #ce1118;
}

.stc-compare-header-cell img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 4px;
}

.stc-compare-header-cell .product-title {
  font-size: 12px;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: block;
}

/* Price Value Row styling */
.stc-compare-price-val {
  font-size: 14px !important;
  font-weight: 800;
  color: #ce1118;
}

/* Availability Badge Row styling */
.stc-compare-availability-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.stc-compare-availability-badge.in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.stc-compare-availability-badge.out-of-stock {
  background: #ffebee;
  color: #c62828;
}

/* Action button row styling */
.stc-compare-action-cell {
  text-align: center;
  padding: 1rem 0.5rem !important;
}

.stc-compare-action-cell form {
  margin: 0;
  display: inline-block;
  width: 100%;
}

.stc-compare-action-cell .stc-btn-add-to-cart {
  background: #ce1118 !important;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.stc-compare-action-cell .stc-btn-add-to-cart:hover {
  background: #e3121b !important;
  box-shadow: 0 4px 12px rgba(206, 17, 24, 0.3);
}

/* ==========================================================================
   MOBILE FIRST RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* sm: 576px (Small Devices, Landscape Phones) */
@media (min-width: 576px) {
  #stc-compare-bar {
    padding: 1rem 0;
  }

  .stc-compare-bar-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 15px;
  }

  .stc-compare-items-list {
    overflow-x: visible;
    padding-bottom: 0;
  }

  .stc-compare-bar-item {
    flex: initial;
    max-width: 180px;
  }

  .stc-compare-bar-actions {
    width: auto;
  }

  .stc-btn-compare-now {
    padding: 8px 20px;
    font-size: 13px;
  }

  .stc-btn-compare-clear {
    font-size: 13px;
  }

  .stc-compare-modal-content {
    width: 92%;
    border-radius: 16px;
  }

  .stc-compare-modal-header {
    padding: 1.25rem 1.5rem;
  }

  .stc-compare-modal-header h2 {
    font-size: 18px;
  }

  .stc-compare-modal-close {
    width: 36px;
    height: 36px;
  }

  .stc-compare-modal-body {
    padding: 1.5rem;
  }

  .stc-compare-table {
    min-width: 700px;
  }

  .stc-compare-table th,
  .stc-compare-table td {
    padding: 10px 12px;
  }

  .stc-compare-table th {
    width: 120px;
    min-width: 110px;
    font-size: 12px;
  }

  .stc-compare-table td {
    min-width: 160px;
    font-size: 13px;
  }

  .stc-compare-header-cell {
    padding: 1.25rem 0.75rem !important;
  }

  .stc-compare-header-cell img {
    width: 80px;
    height: 80px;
  }

  .stc-compare-header-cell .product-title {
    font-size: 13px;
  }

  .stc-compare-price-val {
    font-size: 16px !important;
  }

  .stc-compare-availability-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .stc-compare-action-cell {
    padding: 1.25rem 0.75rem !important;
  }

  .stc-compare-action-cell .stc-btn-add-to-cart {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 8px;
  }
}

/* md: 768px (Medium Devices, Tablets) */
@media (min-width: 768px) {
  .stc-compare-bar-container {
    gap: 1.5rem;
  }

  .stc-compare-bar-item {
    max-width: 200px;
    gap: 6px;
  }

  .stc-compare-bar-item img {
    width: 32px;
    height: 32px;
  }

  .stc-compare-modal-body {
    padding: 2rem;
  }

  .stc-compare-table {
    min-width: 850px;
  }

  .stc-compare-table th {
    width: 150px;
    min-width: 140px;
  }

  .stc-compare-table td {
    min-width: 190px;
  }

  .stc-compare-header-cell img {
    width: 90px;
    height: 90px;
  }

  .stc-compare-price-val {
    font-size: 17px !important;
  }
}

/* lg: 992px (Large Devices, Desktops) */
@media (min-width: 992px) {
  .stc-compare-bar-item {
    max-width: 220px;
    gap: 8px;
  }

  .stc-compare-bar-item img {
    width: 36px;
    height: 36px;
  }

  .stc-compare-modal-header {
    padding: 1.25rem 2rem;
  }

  .stc-compare-modal-header h2 {
    font-size: 20px;
  }

  .stc-compare-table {
    min-width: 1000px;
  }

  .stc-compare-table th,
  .stc-compare-table td {
    padding: 12px 16px;
  }

  .stc-compare-table th {
    width: 180px;
    min-width: 160px;
    font-size: 13px;
  }

  .stc-compare-table td {
    min-width: 210px;
    font-size: 14px;
  }

  .stc-compare-header-cell {
    padding: 1.5rem 1rem !important;
  }

  .stc-compare-header-cell img {
    width: 100px;
    height: 100px;
  }

  .stc-compare-header-cell .product-title {
    font-size: 14px;
  }

  .stc-compare-price-val {
    font-size: 18px !important;
  }

  .stc-compare-action-cell {
    padding: 1.5rem 1rem !important;
  }

  .stc-compare-action-cell .stc-btn-add-to-cart {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
  }
}

/* xl: 1200px (Extra Large Devices) */
@media (min-width: 1200px) {
  .stc-compare-bar-container {
    max-width: 1140px;
  }

  .stc-compare-modal-content {
    max-width: 1140px;
  }

  .stc-compare-table {
    min-width: 1100px;
  }

  .stc-compare-table th {
    width: 200px;
    min-width: 180px;
  }

  .stc-compare-table td {
    min-width: 220px;
  }
}

/* 2xl: 1400px (Double Extra Large Devices) */
@media (min-width: 1400px) {
  .stc-compare-bar-container {
    max-width: 1320px;
  }

  .stc-compare-modal-content {
    max-width: 1300px;
  }
}