/* Selector de Garantías */
.viccarbe-warranties-selector {
  position: relative;
  display: inline-block;
  width: 100%;
}

.warranties-selector-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  background: #ffffff;
  border-radius: 0;
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Tw-Cen-Light';
}

.warranties-selector-trigger svg {
  margin-right: 10px;
  transition: transform 0.3s ease;
}

.warranties-selector-trigger.active svg {
  transform: rotate(180deg);
}

.warranties-selector-dropdown {
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  z-index: 1000;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.warranties-search-box {
  position: relative;
  padding: 16px;
}

.warranties-search-input {
  width: 100%;
  font-family: 'Tw-Cen-Light' !important;
  letter-spacing: 2px;
  padding: 10px 12px 10px 40px;
  border: 1px solid #cccccc;
  border-top: 0px;
  border-left: 0px;
  border-right: 0px;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.warranties-search-input:focus {
  border-color: #000000;
}

.warranties-search-box svg {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666666;
}

.warranties-list-container {
  overflow-y: auto;
  max-height: 300px;
}

.warranties-list {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.warranty-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.warranty-item:hover {
  background: #f5f5f5;
}

.warranty-item:has(input[type="checkbox"]:checked) {
  background: #f5f5f5;
}

.warranty-item input[type="checkbox"] {
  display: none;
}

.warranty-item-content {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
}

.warranty-flag {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.warranty-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.warranty-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.warranty-name {
  font-size: 14px;
  font-weight: 500;
  color: #404040;
}

.warranties-actions {
  padding: 16px;
}

.warranties-download-btn {
  width: 100%;
  font-family: 'Tw-Cen-Light' !important;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent !important;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.warranties-download-btn svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.warranties-download-btn:hover:not(:disabled) svg {
  transform: translateY(2px);
}

.warranties-download-btn:hover:not(:disabled) {
  background: #ffffff;
  color: #000000;
}

.warranties-download-btn:disabled {
  background: #cccccc;
  border-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.warranties-download-btn.downloading {
  position: relative;
  pointer-events: none;
}

.warranties-download-btn.downloading::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: warranty-spin 0.6s linear infinite;
}

@keyframes warranty-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.warranty-item.hidden {
  display: none;
}

/* Scrollbar personalizado */
.warranties-list-container::-webkit-scrollbar {
  width: 8px;
}

.warranties-list-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.warranties-list-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.warranties-list-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .viccarbe-warranties-selector {
    max-width: 100%;
  }
  
  .warranties-selector-dropdown {
    max-height: 400px;
  }
  
  .warranties-list-container {
    max-height: 250px;
  }
  
  .warranties-list {
    grid-template-columns: 1fr;
  }
}
