/**
 * Amazon Style Product - Phase 2 CSS
 * Additional styles for pincode, EMI, FBT, Q&A, etc.
 */

/* =============================================
   Product Badges
============================================= */
.asp-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.asp-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.asp-badge-bestseller {
    background: #FF8C00;
}

.asp-badge-choice {
    background: #232F3E;
}

.asp-badge-new {
    background: #00A650;
}

.asp-badge-toprated {
    background: #FFA41C;
}

.asp-badge-limited {
    background: #CC0C39;
}

/* =============================================
   Pincode Checker
============================================= */
.asp-pincode-checker {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--asp-border);
}

.asp-pincode-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--asp-text);
}

.asp-pincode-form {
    display: flex;
    gap: 8px;
}

.asp-pincode-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    font-size: 14px;
}

.asp-pincode-input:focus {
    outline: none;
    border-color: var(--asp-link);
    box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.1);
}

.asp-pincode-btn {
    padding: 8px 16px;
    background: var(--asp-btn-cart-bg);
    border: 1px solid var(--asp-btn-cart-border);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.asp-pincode-result {
    margin-top: 12px;
    padding: 12px;
    background: var(--asp-bg-secondary);
    border-radius: 4px;
}

.asp-delivery-success {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--asp-success);
    font-weight: 500;
    margin-bottom: 10px;
}

.asp-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asp-delivery-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.asp-option-free {
    color: var(--asp-success);
    font-weight: 600;
}

.asp-option-price {
    color: var(--asp-text);
}

.asp-pincode-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--asp-warning);
    font-size: 13px;
}

/* =============================================
   EMI Calculator
============================================= */
.asp-emi-section {
    margin: 16px 0;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    overflow: hidden;
}

.asp-emi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--asp-bg-secondary);
    cursor: pointer;
    transition: background 0.2s;
}

.asp-emi-header:hover {
    background: #EBEBEB;
}

.asp-emi-icon {
    font-size: 20px;
}

.asp-emi-title {
    font-weight: 600;
    color: var(--asp-text);
}

.asp-emi-preview {
    flex: 1;
    color: var(--asp-text-secondary);
    font-size: 13px;
}

.asp-emi-arrow {
    font-size: 10px;
    color: var(--asp-text-muted);
    transition: transform 0.2s;
}

.asp-emi-header.open .asp-emi-arrow {
    transform: rotate(180deg);
}

.asp-emi-content {
    padding: 16px;
}

.asp-emi-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.asp-emi-tab {
    padding: 8px 16px;
    border: 1px solid var(--asp-border);
    border-radius: 20px;
    background: var(--asp-bg);
    font-size: 13px;
    cursor: pointer;
}

.asp-emi-tab.active {
    background: var(--asp-text);
    color: #fff;
    border-color: var(--asp-text);
}

.asp-emi-tab-content {
    display: none;
}

.asp-emi-tab-content.active {
    display: block;
}

.asp-emi-price {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
}

.asp-emi-value {
    font-weight: 600;
}

.asp-tenure-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.asp-tenure-btn {
    padding: 10px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    background: var(--asp-bg);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.asp-tenure-btn:hover {
    border-color: var(--asp-link);
}

.asp-tenure-btn.active {
    border-color: var(--asp-link);
    background: rgba(0, 113, 133, 0.05);
}

.asp-tenure-months {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.asp-tenure-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    background: var(--asp-success);
    color: #fff;
    font-size: 10px;
    border-radius: 3px;
}

.asp-emi-breakdown {
    margin-top: 20px;
    padding: 16px;
    background: var(--asp-bg-secondary);
    border-radius: 8px;
}

.asp-emi-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.asp-emi-row:last-child {
    margin-bottom: 0;
}

.asp-emi-monthly {
    font-size: 18px;
    font-weight: 600;
    color: var(--asp-price-red);
}

.asp-emi-total {
    font-weight: 500;
}

.asp-free {
    color: var(--asp-success);
    font-weight: 600;
}

.asp-banks-intro {
    font-size: 14px;
    margin-bottom: 12px;
}

.asp-banks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.asp-bank-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--asp-border);
    border-radius: 6px;
    font-size: 13px;
}

.asp-banks-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--asp-text-muted);
}

/* =============================================
   Frequently Bought Together
============================================= */
.asp-fbt-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
}

.asp-fbt-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.asp-fbt-products {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.asp-fbt-plus {
    font-size: 24px;
    color: var(--asp-text-muted);
}

.asp-fbt-product {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    max-width: 200px;
}

.asp-fbt-checkbox {
    margin-top: 4px;
}

.asp-fbt-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.asp-fbt-image img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.asp-fbt-name {
    display: block;
    font-size: 13px;
    color: var(--asp-link);
    text-decoration: none;
    line-height: 1.3;
}

.asp-fbt-name:hover {
    color: var(--asp-link-hover);
}

.asp-fbt-price {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
}

.asp-fbt-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens */
}

.asp-fbt-total {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.asp-fbt-label {
    font-size: 14px;
    color: var(--asp-text-secondary);
}

.asp-fbt-amount {
    display: inline-block;
    font-size: 20px;
    font-weight: 500;
    margin-top: 0;
}

.asp-fbt-add {
    width: auto;
    padding: 10px 24px;
}

/* =============================================
   Compare
============================================= */
.asp-compare-wrapper {
    margin-top: 16px;
}

.asp-compare-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--asp-text-secondary);
}

.asp-compare-checkbox {
    width: 16px;
    height: 16px;
}

.asp-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #232F3E;
    padding: 12px 20px;
    z-index: 9998;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.asp-compare-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.asp-compare-items {
    display: flex;
    gap: 12px;
}

.asp-compare-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 4px;
}

.asp-compare-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.asp-compare-remove {
    cursor: pointer;
    color: var(--asp-text-muted);
}

.asp-compare-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.asp-compare-count {
    color: #fff;
    font-size: 13px;
}

.asp-compare-clear,
.asp-compare-view {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
}

.asp-compare-clear {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
}

/* =============================================
   Q&A Section
============================================= */
.asp-qa-section {
    margin: 30px 0;
    padding-top: 30px;
    border-top: 1px solid var(--asp-border);
}

.asp-qa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.asp-ask-btn {
    padding: 8px 20px;
}

.asp-qa-form {
    padding: 20px;
    background: var(--asp-bg-secondary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.asp-qa-form h4 {
    margin: 0 0 12px;
    font-size: 16px;
}

.asp-qa-search {
    display: flex;
    gap: 10px;
}

.asp-qa-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    font-size: 14px;
}

.asp-qa-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--asp-text-muted);
}

.asp-qa-empty {
    text-align: center;
    padding: 30px;
    background: var(--asp-bg-secondary);
    border-radius: 8px;
}

.asp-qa-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--asp-border-light);
}

.asp-qa-question,
.asp-qa-answer {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.asp-qa-label {
    font-weight: 700;
    color: var(--asp-text);
    min-width: 20px;
}

.asp-qa-text {
    flex: 1;
    font-size: 14px;
}

.asp-qa-by {
    font-size: 12px;
    color: var(--asp-text-muted);
    margin-left: 30px;
}

.asp-qa-no-answer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 30px;
    font-size: 13px;
    color: var(--asp-text-muted);
}

.asp-answer-btn {
    padding: 4px 12px;
    font-size: 12px;
    color: var(--asp-link);
    background: transparent;
    border: 1px solid var(--asp-link);
    border-radius: 4px;
    cursor: pointer;
}

.asp-qa-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 30px;
    font-size: 12px;
    color: var(--asp-text-muted);
}

.asp-qa-helpful {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--asp-link);
    cursor: pointer;
    font-size: 12px;
}

.asp-qa-see-all {
    display: inline-block;
    margin-top: 16px;
    color: var(--asp-link);
    text-decoration: none;
}

/* =============================================
   Gift Wrap
============================================= */
.asp-gift-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--asp-border-light);
}

.asp-gift-wrap-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.asp-gift-wrap-icon {
    font-size: 18px;
}

.asp-gift-wrap-price {
    color: var(--asp-text-muted);
    font-size: 13px;
}

.asp-gift-message {
    margin-top: 12px;
}

.asp-gift-textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    font-size: 13px;
    resize: none;
}

.asp-gift-char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--asp-text-muted);
    margin-top: 4px;
}

/* =============================================
   Recently Viewed
============================================= */
.asp-recently-viewed {
    margin: 30px 0;
    padding-top: 30px;
    border-top: 1px solid var(--asp-border);
}

.asp-recently-carousel {
    position: relative;
    display: flex;
    align-items: center;
}

.asp-carousel-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    background: var(--asp-bg);
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}

.asp-carousel-btn:hover {
    background: var(--asp-bg-secondary);
}

.asp-recently-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    flex: 1;
    margin: 0 10px;
}

.asp-recently-track::-webkit-scrollbar {
    display: none;
}

.asp-recently-item {
    flex: 0 0 auto;
    width: 160px;
}

.asp-recently-link {
    display: block;
    text-decoration: none;
    color: var(--asp-text);
}

.asp-recently-image {
    border: 1px solid var(--asp-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.asp-recently-image img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

.asp-recently-name {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    color: var(--asp-link);
}

.asp-recently-name:hover {
    color: var(--asp-link-hover);
}

.asp-recently-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0;
    font-size: 12px;
}

.asp-recently-price {
    font-size: 14px;
    font-weight: 500;
}

/* =============================================
   Responsive for Phase 2
============================================= */
@media (max-width: 768px) {
    .asp-tenure-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .asp-banks-grid {
        grid-template-columns: 1fr;
    }

    .asp-fbt-container {
        flex-direction: column;
    }

    .asp-fbt-products {
        flex-direction: column;
        width: 100%;
    }

    .asp-fbt-product {
        max-width: 100%;
        width: 100%;
    }

    .asp-compare-bar {
        padding: 10px;
    }

    .asp-compare-items {
        display: none;
    }

    .asp-qa-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}