/**
 * Single Product Page - Offers & Prices Styles
 * Prices section, merchant table, price history
 */

/* ============================================================================
   PRICES SECTION - Compact
   ============================================================================ */

.prices-section {
    margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
    padding: clamp(1.5rem, 2vw, 1.75rem) 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    box-shadow: none;
}

.prices-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-secondary);
}

/* ============================================================================
   PRICES TABLE
   ============================================================================ */

.prices-table__header {
    display: grid;
    grid-template-columns: 1.5fr 130px 100px 80px;
    gap: 12px;
    padding: 10px 12px;
    background-color: var(--accent);
    border-radius: 8px 8px 0 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prices-table__row {
    display: grid;
    grid-template-columns: 1.5fr 130px 100px 80px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
    font-size: 0.8125rem;
}

.prices-table__mobile-label {
    display: none;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}

.prices-table__row:hover {
    background-color: var(--bg-tertiary);
}

.prices-table__row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.prices-table__row.is-lowest {
    background-color: var(--success-bg);
    border-left: 2px solid var(--success);
}

.prices-table__col--shop {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prices-table__shop-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prices-table__logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #fff;
    padding: 2px;
}

.prices-table__shop-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.prices-table__lowest-badge {
    display: inline-flex;
    padding: 2px 6px;
    background-color: var(--success);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 4px;
}

.prices-table__price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.prices-table__shipping {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.prices-table__btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.prices-table__btn-buy:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   MERCHANT TABLE - Compact
   ============================================================================ */

.merchants-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.merchant-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
    font-size: 0.8rem;
}

.merchant-row:first-child {
    border-radius: 8px 8px 0 0;
}

.merchant-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.merchant-row:hover {
    background-color: var(--bg-tertiary);
}

.merchant-row--lowest {
    background-color: var(--success-bg);
    border-left: 2px solid var(--success);
}

.merchant-row__left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.merchant-row__logo-wrap {
    width: 36px;
    height: 36px;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 3px;
}

.merchant-row__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merchant-row__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.merchant-row__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merchant-row__lowest-badge {
    display: inline-flex;
    padding: 2px 5px;
    background-color: var(--success);
    color: #000;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
    flex-shrink: 0;
}

.merchant-row__stock {
    font-size: 0.7rem;
    font-weight: 600;
}

.merchant-row__stock--in {
    color: var(--success);
}

.merchant-row__stock--out {
    color: var(--error);
}

.merchant-row__shipping {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

.merchant-row__center {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    text-align: right;
}

.merchant-row__price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.merchant-row__price-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.merchant-row__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
}

.merchant-row__updated {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.merchant-row__right {
    flex-shrink: 0;
}

.btn-merchant-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: var(--accent);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}

.btn-merchant-buy:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   STOCK BADGE
   ============================================================================ */

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
}

.stock-badge--in-stock {
    background-color: var(--success-bg);
    color: var(--success);
}

.stock-badge--out-stock {
    background-color: var(--error-bg);
    color: var(--error);
}

/* ============================================================================
   PRICES EMPTY / DISCLAIMER
   ============================================================================ */

.prices-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.8rem;
}

.prices-disclaimer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.prices-empty-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.prices-empty-notice svg {
    flex-shrink: 0;
    color: var(--warning);
    margin-top: 1px;
    width: 16px;
    height: 16px;
}

.prices-empty-notice p {
    margin: 0;
    line-height: 1.5;
}

/* ============================================================================
   PRICE HISTORY SECTION - Compact
   ============================================================================ */

.price-history-section {
    margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
    padding: clamp(1.5rem, 2vw, 1.75rem) 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    box-shadow: none;
}

.price-history__toggle {
    display: flex;
    gap: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 3px;
}

.price-history__btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.price-history__btn:hover {
    color: var(--text-primary);
}

.price-history__btn.is-active {
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
}

/* Controls wrapper: toggle + period buttons */
.price-history__controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Supplier toggle checkbox */
.price-history__supplier-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.price-history__supplier-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

.price-history__supplier-toggle span {
    line-height: 1;
}

.price-history__chart-wrapper {
    height: 250px;
    position: relative;
    margin-top: 16px;
}

.price-history__chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.price-history__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 180px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.price-history__stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    flex-wrap: wrap;
}

.price-history__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-history__stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.price-history__stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-history__stat-value--low {
    color: var(--success);
}

.price-history__stat-value--high {
    color: var(--error);
}

.price-history__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 180px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.price-history__empty p {
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary);
}
