/**
 * Frontend CSS for Alibaba-style Single Product Page
 */

:root {
    --yxy-primary: #0ea5e9;
    /* Engineering Blue */
    --yxy-primary-hover: #0284c7;
    --yxy-secondary: #0f172a;
    /* Deep Navy */
    --yxy-secondary-hover: #1e293b;
    --yxy-text-main: #334155;
    /* Slate-700 */
    --yxy-text-secondary: #64748b;
    /* Slate-500 */
    --yxy-border: #e2e8f0;
    /* Slate-200 */
    --yxy-bg-light: #ffffff;
    /* Pure White */
    --yxy-bg-white: #ffffff;
    --yxy-radius: 16px;
    --yxy-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --yxy-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yxy-single-product-alibaba {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.yxy-single-product-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

/* Animations */
@keyframes yxyFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes yxySlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yxy-animate-fade-in {
    animation: yxyFadeIn 0.6s ease-out forwards;
}

.yxy-animate-slide-up {
    opacity: 0;
    animation: yxySlideUp 0.6s ease-out forwards;
}

/* Gallery */
.yxy-single-gallery {
    position: sticky;
    top: 30px;
    height: fit-content;
}

.yxy-single-main-image {
    position: relative;
    background: var(--yxy-bg-white);
    border-radius: var(--yxy-radius);
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 1;
    box-shadow: var(--yxy-shadow);
    border: 1px solid var(--yxy-border);
}

.yxy-single-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.yxy-single-main-image:hover img {
    transform: scale(1.05);
}

.yxy-single-image-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.yxy-single-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.yxy-single-thumb {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--yxy-transition);
    background: var(--yxy-bg-white);
}

.yxy-single-thumb:hover {
    border-color: var(--yxy-primary);
    transform: translateY(-2px);
}

.yxy-single-thumb.active {
    border-color: var(--yxy-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.yxy-single-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.yxy-single-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.yxy-single-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--yxy-text-main);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.yxy-single-subtitle {
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 16px;
    color: var(--yxy-text-secondary);
    line-height: 1.5;
}

.yxy-single-use-cases {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--yxy-bg-light);
    border: 1px solid var(--yxy-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--yxy-primary);
}

.yxy-single-use-cases .label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Pricing */
.yxy-single-pricing {
    padding: 24px;
    background: #ffffff;
    /* Clean White */
    border: 1px solid var(--yxy-border);
    border-radius: var(--yxy-radius);
    box-shadow: var(--yxy-shadow);
}

.yxy-single-dispatch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #b45309;
    font-size: 13px;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.1);
    /* Blue tint */
    color: var(--yxy-primary);
    padding: 6px 10px;
    border-radius: 6px;
    width: fit-content;
}

.yxy-single-tiers {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.yxy-single-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--yxy-bg-white);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--yxy-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.yxy-single-tier:hover {
    border-color: var(--yxy-primary);
    transform: translateX(4px);
}

.yxy-single-tier.active {
    border-color: var(--yxy-primary);
    background: #f0f9ff;
    /* Very light blue for active tier */
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.15);
}

.yxy-single-tier .tier-qty {
    font-size: 14px;
    color: var(--yxy-text-secondary);
    font-weight: 500;
}

.yxy-single-tier .tier-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--yxy-secondary);
}

.yxy-single-note {
    font-size: 12px;
    color: var(--yxy-text-secondary);
    margin-top: 8px;
    opacity: 0.8;
}

/* Quantity Selector */
.yxy-single-quantity {
    padding: 24px;
    background: #ffffff;
    border-radius: var(--yxy-radius);
    border: 1px solid var(--yxy-border);
    box-shadow: var(--yxy-shadow);
}

.yxy-single-quantity label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--yxy-text-main);
}

.yxy-qty-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.yxy-qty-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--yxy-border);
    border-radius: 8px;
    transition: var(--yxy-transition);
    background: var(--yxy-bg-white);
}

.yxy-qty-input:focus {
    outline: none;
    border-color: var(--yxy-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.yxy-qty-unit {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yxy-text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.yxy-price-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.yxy-price-display .label {
    display: block;
    font-size: 12px;
    color: var(--yxy-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yxy-price-display .price {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--yxy-text-main);
}

.yxy-price-display .total-price .price {
    color: var(--yxy-secondary);
    font-size: 24px;
}

/* Action Buttons */
.yxy-single-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yxy-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.yxy-btn-add-cart,
.yxy-btn-whatsapp,
.yxy-btn-alibaba,
.yxy-btn-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--yxy-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.yxy-btn-add-cart {
    background: var(--yxy-secondary);
    color: #fff;
    font-size: 16px;
}

.yxy-btn-add-cart:hover {
    background: var(--yxy-secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.yxy-btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.yxy-btn-whatsapp:hover {
    background: #1fb855;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.yxy-btn-alibaba {
    background: #fff;
    color: var(--yxy-primary);
    border: 2px solid var(--yxy-primary);
}

.yxy-btn-alibaba:hover {
    background: var(--yxy-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 106, 0, 0.3);
}

.yxy-btn-email {
    background: #007bff;
    color: #fff;
    margin-top: 10px;
    width: 100%;
}

.yxy-btn-email:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

/* Highlights */
.yxy-single-highlights {
    padding: 20px;
    background: var(--yxy-bg-white);
    border: 1px solid var(--yxy-border);
    border-radius: var(--yxy-radius);
}

.yxy-single-highlights h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--yxy-text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.yxy-single-highlights h3:before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--yxy-primary);
    border-radius: 2px;
}

.yxy-single-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yxy-single-highlights li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--yxy-text-main);
    line-height: 1.5;
    font-size: 14px;
}

.yxy-single-highlights li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--yxy-primary);
    font-weight: bold;
    font-size: 12px;
}

/* Description */
.yxy-single-description {
    margin-top: 40px;
    padding: 30px;
    background: var(--yxy-bg-white);
    border: 1px solid var(--yxy-border);
    border-radius: var(--yxy-radius);
    box-shadow: var(--yxy-shadow);
}

.yxy-single-description h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--yxy-text-main);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--yxy-bg-light);
}

.yxy-description-content {
    line-height: 1.7;
    color: #333;
    font-size: 15px;
}

/* Reviews */
.yxy-single-reviews {
    margin-top: 30px;
    padding: 30px;
    background: var(--yxy-bg-white);
    border: 1px solid var(--yxy-border);
    border-radius: var(--yxy-radius);
    box-shadow: var(--yxy-shadow);
}

.yxy-reviews-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--yxy-text-main);
}

.yxy-reviews-list {
    display: grid;
    gap: 20px;
}

.yxy-review-card {
    padding: 20px;
    background: var(--yxy-bg-light);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: var(--yxy-transition);
}

.yxy-review-card:hover {
    background: var(--yxy-bg-white);
    border-color: var(--yxy-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.yxy-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.yxy-review-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.yxy-review-rating .star {
    color: #e0e0e0;
    font-size: 14px;
}

.yxy-review-rating .star.filled {
    color: #ffc107;
}

.yxy-review-author strong {
    font-size: 15px;
    color: var(--yxy-text-main);
    display: block;
}

.yxy-review-date {
    font-size: 12px;
    color: var(--yxy-text-secondary);
}

.yxy-review-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--yxy-text-main);
}

.yxy-review-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--yxy-text-secondary);
    margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .yxy-single-product-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .yxy-single-gallery {
        position: static;
    }

    .yxy-single-main-image {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 576px) {
    .yxy-single-product-alibaba {
        padding: 20px 16px;
    }

    .yxy-single-title {
        font-size: 22px;
    }

    .yxy-price-display {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .yxy-secondary-actions {
        grid-template-columns: 1fr;
    }

    /* Highlights */
    .yxy-single-highlights {
        padding: 20px;
        background: var(--yxy-bg-white);
        border: 1px solid var(--yxy-border);
        border-radius: var(--yxy-radius);
    }

    .yxy-single-highlights h3 {
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 16px;
        color: var(--yxy-text-main);
        text-transform: uppercase;
        letter-spacing: 1px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .yxy-single-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .yxy-single-description,
    .yxy-single-reviews {
        padding: 20px;
    }
}

/* Split Button Styles */
.yxy-added-to-cart {
    width: 48% !important;
    display: inline-block !important;
    margin-right: 2% !important;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    cursor: default !important;
}

.yxy-go-to-cart-btn {
    width: 48% !important;
    display: inline-block !important;
    text-align: center;
    padding: 12px 20px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    vertical-align: middle;
    box-sizing: border-box;
}

.yxy-go-to-cart-btn:hover {
    background-color: #333;
    color: #fff;
}