/**
 * Amazon Style Product - Main CSS
 * Color scheme and layout matching Amazon
 */

/* =============================================
   CSS Variables (Amazon Design Tokens)
============================================= */
:root {
    --asp-bg: #FFFFFF;
    --asp-bg-secondary: #F5F5F5;
    --asp-bg-card: #FAFAFA;
    --asp-border: #DDD;
    --asp-border-light: #E3E3E3;

    --asp-text: #0F1111;
    --asp-text-secondary: #565959;
    --asp-text-muted: #767676;

    --asp-link: #007185;
    --asp-link-hover: #C7511F;

    --asp-price: #0F1111;
    --asp-price-red: #B12704;
    --asp-discount: #CC0C39;

    --asp-success: #007600;
    --asp-warning: #B12704;
    --asp-stars: #FFA41C;

    --asp-btn-cart-bg: linear-gradient(to bottom, #FFD814, #F7CA00);
    --asp-btn-cart-border: #FCD200;
    --asp-btn-cart-hover: linear-gradient(to bottom, #F7CA00, #E5B800);

    --asp-btn-buy-bg: linear-gradient(to bottom, #FFA41C, #FA8900);
    --asp-btn-buy-border: #FF8F00;
    --asp-btn-buy-hover: linear-gradient(to bottom, #FA8900, #E07800);

    --asp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =============================================
   Reset & Base
============================================= */
.asp-product-container {
    font-family: var(--asp-font-family);
    color: var(--asp-text);
    background: var(--asp-bg);
    line-height: 1.5;
    font-size: 14px;
}

.asp-product-container * {
    box-sizing: border-box;
}

/* =============================================
   Breadcrumbs
============================================= */
.asp-breadcrumbs {
    padding: 12px 0;
    font-size: 12px;
    color: var(--asp-text-secondary);
}

.asp-breadcrumbs a {
    color: var(--asp-link);
    text-decoration: none;
}

.asp-breadcrumbs a:hover {
    color: var(--asp-link-hover);
    text-decoration: underline;
}

.asp-breadcrumb-sep {
    margin: 0 6px;
    color: var(--asp-text-muted);
}

.asp-brand-link {
    margin-bottom: 8px;
}

.asp-brand-link a {
    color: var(--asp-link);
    font-size: 13px;
    text-decoration: none;
}

.asp-brand-link a:hover {
    text-decoration: underline;
    color: var(--asp-link-hover);
}

/* =============================================
   3-Column Layout
============================================= */
.asp-product-layout {
    display: grid;
    grid-template-columns: 350px 1fr 280px;
    gap: 20px;
    padding: 20px 0;
}

.asp-col-gallery {
    position: relative;
}

.asp-col-info {
    padding-right: 20px;
}

.asp-col-buybox {
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    padding: 16px;
    background: var(--asp-bg);
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* =============================================
   Gallery
============================================= */
.asp-gallery {
    position: relative;
}

.asp-gallery-share {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asp-share-btn,
.asp-wishlist-icon-only {
    background: var(--asp-bg);
    border: 1px solid var(--asp-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.2s;
    color: #565959;
}

.asp-share-btn:hover,
.asp-wishlist-icon-only:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Shop Loop Wishlist Button */
.asp-loop-wishlist-wrapper {
    transition: opacity 0.2s;
}

/* Header Wishlist Count */
.asp-header-wishlist-count {
    animation: asp-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes asp-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.asp-gallery-wrapper {
    display: flex;
    gap: 10px;
}

.asp-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 40px;
}



/* =============================================
   Rating Popover (Amazon Style - High Fidelity)
============================================= */
.asp-rating-row-wrapper {
    position: relative;
    display: inline-block;
}

.asp-stars-popover-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.asp-popover-arrow {
    width: 10px;
    height: 10px;
    stroke: #565959;
    transition: transform 0.2s;
}

.asp-stars-popover-trigger:hover .asp-popover-arrow {
    transform: rotate(180deg);
}

.asp-rating-popover {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: #FFFFFF;
    border: none;
    /* No border as per reference */
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    /* Soft drop shadow */
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    font-family: "Amazon Ember", Arial, sans-serif;
    /* System sans */
}

.asp-rating-popover.visible,
.asp-rating-row-wrapper:hover .asp-rating-popover {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.asp-popover-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.asp-popover-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.asp-popover-rating {
    font-weight: 700;
    /* Semi-bold */
    font-size: 18px;
    color: #0F1111;
    /* Near black */
    line-height: 1.2;
}

.asp-popover-global-count {
    font-size: 13px;
    color: #565959;
    /* Neutral gray */
    margin-bottom: 16px;
}

/* Distribution Bars */
.asp-rating-popover .asp-distribution-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #0F1111;
    /* Dark gray labels */
}

.asp-rating-popover .asp-dist-label {
    width: 45px;
    color: #007185;
    /* Link color if interactable, else #0F1111 or #565959 */
    white-space: nowrap;
}

/* Make rows look like links on hover if needed, or just specific text */
.asp-rating-popover .asp-dist-label:hover {
    text-decoration: underline;
    cursor: pointer;
}

.asp-rating-popover .asp-dist-bar {
    flex: 1;
    height: 14px;
    /* Slightly thicker */
    background: #F0F2F2;
    /* Standard light gray */
    border: 1px solid #E0E0E0;
    /* Subtle border for empty state */
    border-radius: 4px;
    /* Light rounding */
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.asp-rating-popover .asp-dist-fill {
    height: 100%;
    background: #FFA41C;
    /* Amazon Orange */
    border-right: 1px solid #DE7921;
}

.asp-rating-popover .asp-dist-pct {
    font-size: 13px;
    color: #007185;
    text-align: right;
    width: 35px;
}

.asp-rating-popover .asp-dist-pct:hover {
    text-decoration: underline;
    cursor: pointer;
}

.asp-popover-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E3E3E3;
    text-align: left;
    /* Align left */
}

.asp-popover-footer a {
    color: #007185;
    /* Amazon Link Blue */
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    /* Regular */
}

.asp-popover-footer a:hover {
    text-decoration: underline;
    color: #C7511F;
}


.asp-thumb {
    width: 40px;
    height: 40px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}

.asp-thumb:hover,
.asp-thumb.active {
    border-color: var(--asp-link);
    border-width: 2px;
}

.asp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asp-main-image-container {
    flex: 1;
    position: relative;
    border: 1px solid var(--asp-border-light);
    border-radius: 4px;
    overflow: hidden;
}

.asp-main-image {
    text-align: center;
    cursor: zoom-in;
}

.asp-main-image img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
}

.asp-zoom-lens {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 1px solid var(--asp-link);
    background: rgba(0, 113, 133, 0.1);
    display: none;
    pointer-events: none;
}

.asp-zoom-result {
    position: absolute;
    right: -320px;
    top: 0;
    width: 300px;
    height: 300px;
    border: 1px solid var(--asp-border);
    background-repeat: no-repeat;
    display: none;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.asp-image-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.asp-lightbox-hint {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--asp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* =============================================
   Product Info
============================================= */
.asp-product-title {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 8px;
    color: var(--asp-text);
}

.asp-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.asp-stars {
    display: inline-flex;
}

.asp-star {
    color: var(--asp-border);
    font-size: 16px;
}

.asp-star.filled {
    color: var(--asp-stars);
}

.asp-rating-value {
    color: var(--asp-link);
    font-weight: 500;
}

.asp-rating-count {
    color: var(--asp-link);
    text-decoration: none;
}

.asp-rating-count:hover {
    color: var(--asp-link-hover);
    text-decoration: underline;
}

.asp-divider {
    border: none;
    border-top: 1px solid var(--asp-border-light);
    margin: 16px 0;
}

/* =============================================
   Price Block
============================================= */
.asp-price-block {
    margin: 12px 0;
}

.asp-discount-badge {
    display: inline-block;
    background: var(--asp-discount);
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
}

.asp-current-price {
    font-size: 24px;
    color: var(--asp-price);
}

.asp-current-price .woocommerce-Price-amount {
    font-size: 24px;
}

.asp-original-price {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--asp-text-secondary);
}

.asp-original-price del {
    color: var(--asp-text-secondary);
}

.asp-tax-note {
    font-size: 12px;
    color: var(--asp-text-muted);
    margin-top: 4px;
}

/* =============================================
   Deal Badge
============================================= */
.asp-deal-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #CC0C39;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 12px 0;
}

.asp-deal-label {
    font-weight: 600;
    font-size: 14px;
}

.asp-deal-timer {
    font-size: 13px;
}

#asp-countdown {
    font-family: monospace;
    font-weight: 600;
}

/* =============================================
   Offer Cards
============================================= */
.asp-offers-section {
    margin: 16px 0;
}

.asp-offers-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.asp-offer-card {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    background: var(--asp-bg);
}

.asp-offer-icon {
    font-size: 24px;
}

.asp-offer-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--asp-text);
}

.asp-offer-text {
    font-size: 12px;
    color: var(--asp-text-secondary);
    line-height: 1.3;
}

/* =============================================
   Variants
============================================= */
.asp-variants {
    margin: 16px 0;
}

.asp-variant-group {
    margin-bottom: 16px;
}

.asp-variant-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.asp-variant-selected {
    font-weight: 400;
}

.asp-variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Color Swatches */
.asp-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--asp-border);
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.asp-color-swatch:hover,
.asp-color-swatch.selected {
    border-color: var(--asp-link);
}

.asp-swatch-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    display: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.asp-color-swatch.selected .asp-swatch-check {
    display: block;
}

/* Size Chips */
.asp-size-chip {
    padding: 8px 16px;
    border: 1px solid var(--asp-border);
    border-radius: 4px;
    background: var(--asp-bg);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.asp-size-chip:hover {
    border-color: var(--asp-link);
}

.asp-size-chip.selected {
    border-color: var(--asp-link);
    box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.1);
}

.asp-size-chip.unavailable {
    background: var(--asp-bg-secondary);
    color: var(--asp-text-muted);
    cursor: not-allowed;
    text-decoration: line-through;
}

.asp-size-chart-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--asp-link);
    font-size: 13px;
    text-decoration: none;
}

.asp-size-chart-link:hover {
    text-decoration: underline;
}

/* =============================================
   About This Item
============================================= */
.asp-section-heading {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--asp-text);
}

.asp-features-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.asp-features-list li {
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--asp-text);
}

/* =============================================
   Buy Box
============================================= */
.asp-buybox-price {
    margin-bottom: 12px;
}

.asp-discount-badge-sm {
    display: inline-block;
    background: var(--asp-discount);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
}

.asp-buybox-amount {
    font-size: 24px;
    font-weight: 400;
}

.asp-stock-status {
    font-size: 18px;
    margin-bottom: 12px;
}

.asp-stock-status.in-stock .asp-stock-ok {
    color: var(--asp-success);
}

.asp-stock-status.in-stock .asp-stock-low {
    color: var(--asp-warning);
    font-size: 14px;
}

.asp-stock-status.out-of-stock .asp-stock-out {
    color: var(--asp-warning);
}

.asp-delivery-info {
    margin-bottom: 12px;
    font-size: 14px;
}

.asp-delivery-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.asp-delivery-label {
    color: var(--asp-text-secondary);
}

.asp-delivery-date {
    color: var(--asp-text);
    font-weight: 500;
}

.asp-express .asp-delivery-label {
    color: var(--asp-link);
}

.asp-location-select {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.asp-location-link {
    color: var(--asp-link);
    text-decoration: none;
}

.asp-quantity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.asp-qty-select {
    padding: 6px 24px 6px 10px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    background: #F0F2F2;
    font-size: 13px;
}

/* Buttons */
.asp-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.asp-btn-cart {
    background: var(--asp-btn-cart-bg);
    border-color: var(--asp-btn-cart-border);
    color: var(--asp-text);
    margin-bottom: 8px;
}

.asp-btn-cart:hover {
    background: var(--asp-btn-cart-hover);
}

.asp-btn-buy {
    background: var(--asp-btn-buy-bg);
    border-color: var(--asp-btn-buy-border);
    color: var(--asp-text);
}

.asp-btn-buy:hover {
    background: var(--asp-btn-buy-hover);
}

.asp-btn-outline {
    background: var(--asp-bg);
    border: 1px solid var(--asp-border);
    color: var(--asp-text);
}

.asp-btn-outline:hover {
    background: var(--asp-bg-secondary);
}

.asp-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--asp-link);
    cursor: pointer;
}

.asp-wishlist-btn:hover {
    background: var(--asp-bg-secondary);
}

.asp-secure-badge,
.asp-returns-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--asp-text-secondary);
    margin: 8px 0;
}

.asp-returns-link {
    color: var(--asp-link);
    text-decoration: none;
    margin-left: auto;
}

.asp-seller-info {
    font-size: 12px;
    margin-top: 12px;
}

.asp-seller-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.asp-seller-label {
    color: var(--asp-text-muted);
}

.asp-seller-value {
    color: var(--asp-link);
}

/* =============================================
   Reviews Section
============================================= */
.asp-reviews-section {
    border-top: 1px solid var(--asp-border);
    padding-top: 30px;
    margin-top: 30px;
}

.asp-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.asp-reviews-header {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.asp-reviews-overall {
    text-align: center;
}

.asp-overall-stars {
    font-size: 20px;
}

.asp-overall-text {
    font-size: 16px;
    margin: 8px 0;
}

.asp-overall-count {
    font-size: 13px;
    color: var(--asp-text-secondary);
}

.asp-distribution-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.asp-dist-label {
    width: 50px;
    font-size: 13px;
    color: var(--asp-link);
}

.asp-dist-bar {
    flex: 1;
    height: 18px;
    background: var(--asp-bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.asp-dist-fill {
    height: 100%;
    background: var(--asp-stars);
}

.asp-dist-pct {
    width: 40px;
    font-size: 13px;
    color: var(--asp-link);
    text-align: right;
}

.asp-reviews-summary {
    background: var(--asp-bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.asp-reviews-summary h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.asp-summary-text {
    font-size: 14px;
    color: var(--asp-text-secondary);
    margin: 0;
}

.asp-attribute-ratings {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.asp-attr-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--asp-border);
    border-radius: 16px;
    font-size: 13px;
}

.asp-attr-name {
    color: var(--asp-text-secondary);
}

.asp-attr-stars {
    color: var(--asp-stars);
}

.asp-reviews-list h4 {
    font-size: 16px;
    margin-bottom: 16px;
}

.asp-review-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--asp-border-light);
}

.asp-review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.asp-reviewer-avatar img {
    border-radius: 50%;
}

.asp-reviewer-name {
    font-size: 14px;
    font-weight: 500;
}

.asp-review-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.asp-review-stars .asp-star {
    font-size: 14px;
}

.asp-verified-badge {
    font-size: 12px;
    color: var(--asp-warning);
    font-weight: 500;
}

.asp-review-date {
    font-size: 12px;
    color: var(--asp-text-muted);
    margin-bottom: 8px;
}

.asp-review-content {
    font-size: 14px;
    line-height: 1.6;
}

.asp-see-more-reviews {
    display: inline-block;
    margin-top: 16px;
    color: var(--asp-link);
    text-decoration: none;
}

.asp-write-review {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid var(--asp-border);
    border-radius: 8px;
    text-align: center;
}

.asp-write-review h4 {
    margin: 0 0 8px;
}

.asp-write-review p {
    margin: 0 0 16px;
    color: var(--asp-text-secondary);
    font-size: 14px;
}

/* =============================================
   Related Products
============================================= */
.asp-related-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--asp-border);
}

.asp-related-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* =============================================
   Mobile Sticky
============================================= */
.asp-mobile-sticky {
    display: none;
}