/* Layout Principal */
body.hs-modal-open {
    overflow: hidden !important;
}

.hs-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

.hs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .hs-grid {
        grid-template-columns: 1fr;
    }
}

/* Galería */
.hs-gallery-wrapper {
    width: 100%;
}

.hs-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
}

.hs-img-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    z-index: 10;
}

/* Botones / Flechas de Navegación */
.hs-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.hs-carousel-btn:hover {
    background: #0f172a;
    transform: translateY(-50%) scale(1.08);
}

.hs-prev { left: 12px; }
.hs-next { right: 12px; }

.hs-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.hs-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}

.hs-thumb.active {
    border-color: #ff6600;
}

.hs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Módulo Lateral */
.hs-badges-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.hs-top-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.hs-top-badge.main {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.hs-top-badge.secondary {
    background: #f1f5f9;
    color: #475569;
}

.hs-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.hs-sku {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.hs-badge-store-above {
    display: inline-block;
    background: #ff6600;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 16px;
}

.hs-badge-store-above span {
    font-weight: 700;
    color: #ffffff;
}

/* Timer */
.hs-timer-box {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.hs-timer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.hs-timer-pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.hs-countdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hs-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hs-time-unit span {
    font-size: 24px;
    font-weight: 800;
}

.hs-time-unit small {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
}

.hs-time-sep {
    font-size: 20px;
    font-weight: 700;
    color: #475569;
}

.hs-finished-banner {
    color: #ef4444;
    font-weight: 800;
    font-size: 18px;
    text-align: center;
}

/* Tarjeta de Precio */
.hs-price-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.hs-price-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.hs-price-user {
    font-weight: 700;
    color: #0f172a;
}

.hs-price-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.hs-currency {
    font-size: 22px;
    font-weight: 800;
    color: #ff6600;
}

.hs-amount {
    font-size: 40px;
    font-weight: 900;
    color: #ff6600;
    letter-spacing: -1px;
}

.hs-price-base {
    font-size: 13px;
    color: #64748b;
}

.hs-warning-box {
    margin-top: 12px;
    background: #fffbebf5;
    border: 1px solid #fef3c7;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #b45309;
    line-height: 1.4;
}

/* Botón Principal y Cooldown */
.hs-btn-primary {
    width: 100%;
    background: #ff6600;
    color: #ffffff;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.hs-btn-primary:hover {
    background: #e65c00;
    transform: translateY(-1px);
}

.hs-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.hs-bid-lock-message {
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.hs-bid-lock-message strong {
    font-weight: 800;
}

/* Botón Estilizado de Términos y Condiciones */
.hs-terms-trigger-container {
    margin: 15px 0 25px 0;
    width: 100%;
}

.hs-terms-card-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    text-align: left;
}

.hs-terms-card-btn:hover {
    border-color: #ff6600;
    background: #fffdfa;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.12);
}

.hs-terms-icon {
    font-size: 18px;
    margin-right: 12px;
}

.hs-terms-text {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.hs-terms-arrow {
    font-size: 16px;
    color: #ff6600;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.hs-terms-card-btn:hover .hs-terms-arrow {
    transform: translateX(4px);
}

/* Historial */
.hs-history-box {
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.hs-history-box h3 {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
}

.hs-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hs-history-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.hs-history-list .hs-user {
    font-weight: 600;
    color: #334155;
}

.hs-history-list .hs-monto {
    font-weight: 700;
    color: #ff6600;
}

.hs-empty-history {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

/* Modales */
.hs-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.hs-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 16px;
    padding: 28px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    box-sizing: border-box;
}

.hs-modal-container.hs-modal-terms-container {
    max-width: 750px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.hs-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hs-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.hs-modal-header h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.hs-modal-header p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #64748b;
}

/* Formulario */
.hs-form-group {
    margin-bottom: 14px;
}

.hs-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

.hs-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.hs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hs-form-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.hs-data-consent {
    font-size: 11px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.hs-btn-submit {
    width: 100%;
    background: #ff6600;
    color: #ffffff;
    border: none;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
}

.hs-form-status {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.hs-status-error { color: #ef4444; }
.hs-status-success { color: #22c55e; }

/* Descripción del Producto */
.hs-description {
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}

.hs-description h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
}

/* Cuerpo del Modal de Términos con Scroll */
.hs-terms-content-body {
    flex: 1;
    overflow-y: auto !important;
    margin-top: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    padding-right: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
    text-align: left;
}

.hs-terms-content-body::-webkit-scrollbar {
    width: 6px;
}

.hs-terms-content-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.hs-terms-content-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.hs-terms-content-body p {
    margin-bottom: 12px;
}

/* Responsive Fixes */
#huaman-subasta-card, #huaman-subasta-card * {
    box-sizing: border-box;
}

@media (max-width: 600px) {
    #huaman-subasta-card .hs-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    #huaman-subasta-card .hs-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .hs-modal-container {
        padding: 22px 18px;
    }
}