/**
 * JimRebecca Single Product Page Styles
 * Product detail styles
 */

/* Product Detail Layout */
.product-detail {
    padding: var(--space-8) 0 var(--space-20);
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.gallery-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-gray-100);
}

.gallery-stage {
    aspect-ratio: 3/4;
    position: relative;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--color-gray-700);
    transition: all var(--transition-fast);
    z-index: 10;
}

.gallery-nav:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.gallery-nav.prev {
    left: var(--space-4);
}

.gallery-nav.next {
    right: var(--space-4);
}

.gallery-nav svg {
    stroke: currentColor;
}

/* Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.thumb-item {
    width: 80px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
    cursor: pointer;
}

.thumb-item.active {
    border-color: var(--color-primary);
}

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

/* Product Info Panel */
.product-info-panel {
    padding-top: var(--space-4);
}

.info-header {
    margin-bottom: var(--space-6);
}

.product-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    line-height: 1.3;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.price-sale {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-primary);
}

.price-regular {
    font-size: var(--text-xl);
    text-decoration: line-through;
    color: var(--color-gray-500);
}

.price-current {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-primary);
}

.price-badge {
    padding: var(--space-1) var(--space-3);
    background-color: var(--color-error);
    color: var(--color-white);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.product-summary {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-gray-200);
    color: var(--color-gray-600);
    line-height: 1.8;
}

/* Variant Selector */
.variant-selector {
    margin-bottom: var(--space-6);
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.selector-label {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-gray-700);
}

.size-guide-link {
    font-size: var(--text-sm);
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.size-option {
    position: relative;
}

.size-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.size-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 var(--space-4);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.size-option input:checked + .size-label {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-white);
}

.size-option input:disabled + .size-label {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.size-option input:focus + .size-label {
    box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}

.stock-hint {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    color: var(--color-error);
}

/* Quantity Selector */
.quantity-selector {
    margin-bottom: var(--space-6);
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-gray-700);
    background-color: var(--color-gray-100);
    transition: background-color var(--transition-fast);
}

.qty-btn:hover {
    background-color: var(--color-gray-200);
}

.qty-input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: none;
    font-weight: 500;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Purchase Actions */
.purchase-actions {
    margin-bottom: var(--space-8);
}

.add-to-cart {
    width: 100%;
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-price {
    opacity: 0.8;
    font-weight: 400;
}

.btn-price::before {
    content: '-';
    margin: 0 var(--space-2);
}

/* Product Meta */
.product-meta {
    padding: var(--space-6) 0;
    border-top: 1px solid var(--color-gray-200);
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: var(--space-6);
}

.meta-item {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-label {
    color: var(--color-gray-600);
}

.meta-value {
    color: var(--color-gray-800);
    font-weight: 500;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    gap: var(--space-6);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.badge-icon {
    font-size: var(--text-lg);
}

/* Product Details Tabs */
.product-details {
    margin-bottom: var(--space-16);
}

.details-tabs {
    display: flex;
    gap: var(--space-8);
    border-bottom: 2px solid var(--color-gray-200);
    margin-bottom: var(--space-8);
}

.tab-btn {
    padding: var(--space-4) 0;
    font-weight: 500;
    color: var(--color-gray-600);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    min-height: 200px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.description-content {
    line-height: 1.8;
    color: var(--color-gray-700);
}

.description-content h3 {
    margin: var(--space-6) 0 var(--space-3);
    font-size: var(--text-xl);
}

.description-content ul {
    list-style: disc;
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.description-content li {
    margin-bottom: var(--space-2);
}

.shipping-info h3 {
    font-size: var(--text-lg);
    margin: var(--space-6) 0 var(--space-3);
}

.shipping-info h3:first-child {
    margin-top: 0;
}

.shipping-info ul {
    list-style: disc;
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
    color: var(--color-gray-700);
}

.shipping-info li {
    margin-bottom: var(--space-2);
}

/* Size Guide Table */
.size-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-4);
}

.size-table th,
.size-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.size-table th {
    font-weight: 600;
    color: var(--color-gray-700);
    background-color: var(--color-gray-100);
}

.size-table td {
    color: var(--color-gray-600);
}

/* Related Products */
.related-products {
    padding-top: var(--space-12);
    border-top: 1px solid var(--color-gray-200);
}

.related-products .section-title {
    text-align: center;
    margin-bottom: var(--space-8);
    font-size: var(--text-2xl);
}

/* Responsive */
@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .product-gallery {
        position: static;
    }
    
    .gallery-stage {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 768px) {
    .product-title {
        font-size: var(--text-2xl);
    }
    
    .details-tabs {
        gap: var(--space-4);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
    
    .trust-badges {
        flex-wrap: wrap;
        gap: var(--space-4);
    }
}

@media (max-width: 480px) {
    .gallery-thumbs {
        gap: var(--space-2);
    }
    
    .thumb-item {
        width: 60px;
        height: 75px;
    }
    
    .size-options {
        gap: var(--space-2);
    }
    
    .size-label {
        min-width: 40px;
        height: 40px;
        padding: 0 var(--space-3);
    }
}
