/* Product Detail Page Styles */

.product-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-4xl);
    padding: 140px 0 var(--gap-4xl);
}

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

.main-image {
    position: relative;
    background: var(--hue-white);
    border-radius: var(--corner-lg);
    overflow: hidden;
    margin-bottom: var(--gap-md);
    box-shadow: var(--elevation-sm);
}

.main-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.image-badge {
    position: absolute;
    top: var(--gap-lg);
    left: var(--gap-lg);
    padding: var(--gap-xs) var(--gap-md);
    background: var(--hue-secondary);
    color: var(--hue-white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--corner-full);
}

.thumbnail-list {
    display: flex;
    gap: var(--gap-md);
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--corner-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--ease-fast);
    background: var(--hue-white);
    box-shadow: var(--elevation-sm);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--hue-secondary);
}

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

/* Product Info */
.product-info {
    padding-top: var(--gap-lg);
}

.product-meta {
    margin-bottom: var(--gap-md);
}

.product-category {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hue-secondary);
}

.product-name {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--hue-primary);
    margin-bottom: var(--gap-md);
    line-height: 1.2;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: var(--gap-md);
    margin-bottom: var(--gap-xl);
}

.cost-current {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--hue-primary);
}

.cost-original {
    font-size: 1.25rem;
    color: var(--hue-text-muted);
    text-decoration: line-through;
}

.cost-saving {
    font-size: 0.875rem;
    color: var(--hue-success);
    font-weight: 500;
}

.product-short-desc {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--hue-text-light);
    margin-bottom: var(--gap-xl);
    padding-bottom: var(--gap-xl);
    border-bottom: 1px solid var(--hue-border);
}

/* Product Form */
.product-form {
    margin-bottom: var(--gap-xl);
}

.form-group {
    margin-bottom: var(--gap-lg);
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hue-primary);
    margin-bottom: var(--gap-sm);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 1px solid var(--hue-border);
    border-radius: var(--corner-md);
    overflow: hidden;
}

.qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hue-white);
    color: var(--hue-text);
    font-size: 1.25rem;
    transition: all var(--ease-fast);
}

.qty-btn:hover {
    background: var(--hue-background);
}

.qty-input {
    width: 60px;
    height: 44px;
    border: none;
    border-left: 1px solid var(--hue-border);
    border-right: 1px solid var(--hue-border);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hue-primary);
}

.add-to-basket {
    width: 100%;
    padding: var(--gap-lg);
    font-size: 1rem;
    margin-bottom: var(--gap-lg);
}

.product-actions {
    display: flex;
    gap: var(--gap-md);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    padding: var(--gap-md);
    border: 1px solid var(--hue-border);
    border-radius: var(--corner-md);
    font-size: 0.9375rem;
    color: var(--hue-text);
    background: var(--hue-white);
    transition: all var(--ease-fast);
}

.action-btn:hover {
    border-color: var(--hue-secondary);
    color: var(--hue-secondary);
}

/* Product Features */
.product-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
    margin-bottom: var(--gap-xl);
    padding: var(--gap-lg);
    background: var(--hue-white);
    border-radius: var(--corner-lg);
    box-shadow: var(--elevation-sm);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    font-size: 0.875rem;
    color: var(--hue-text-light);
}

.feature-item svg {
    color: var(--hue-secondary);
    flex-shrink: 0;
}

/* Product Tabs */
.product-tabs {
    margin-top: var(--gap-3xl);
}

.tab-list {
    display: flex;
    gap: var(--gap-xl);
    border-bottom: 1px solid var(--hue-border);
    margin-bottom: var(--gap-xl);
}

.tab-btn {
    padding: var(--gap-md) 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hue-text-light);
    position: relative;
    transition: color var(--ease-fast);
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--hue-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--hue-secondary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--hue-text-light);
}

.tab-content h4 {
    font-size: 1.125rem;
    color: var(--hue-primary);
    margin: var(--gap-xl) 0 var(--gap-md);
}

.tab-content ul {
    margin-left: var(--gap-lg);
    margin-bottom: var(--gap-md);
}

.tab-content li {
    margin-bottom: var(--gap-sm);
}

/* Related Products */
.related-section {
    padding: var(--gap-4xl) 0;
    background: linear-gradient(to bottom, var(--hue-white), var(--hue-background));
    border-top: 1px solid var(--hue-border);
}

.related-header {
    text-align: center;
    margin-bottom: var(--gap-2xl);
}

.related-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--gap-sm);
}

.related-subtitle {
    color: var(--hue-text-light);
    font-size: 1.0625rem;
}

.related-scroll {
    display: flex;
    gap: var(--gap-xl);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: var(--gap-md) var(--gap-sm);
    margin: 0 calc(-1 * var(--gap-sm));
    -webkit-overflow-scrolling: touch;
}

.related-scroll::-webkit-scrollbar {
    display: none;
}

.related-scroll .item-tile {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: var(--hue-white);
    border-radius: var(--corner-md);
    overflow: hidden;
    box-shadow: var(--elevation-sm);
    transition: transform var(--ease-fast), box-shadow var(--ease-fast);
}

.related-scroll .item-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--elevation-md);
}

.related-scroll .item-visual {
    aspect-ratio: 1;
    overflow: hidden;
}

.related-scroll .item-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ease-slow);
}

.related-scroll .item-tile:hover .item-visual img {
    transform: scale(1.05);
}

.related-scroll .item-info {
    padding: var(--gap-md);
}

.related-scroll .item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hue-text);
    margin-bottom: var(--gap-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.related-scroll .item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.related-scroll .cost {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hue-primary);
}

.related-scroll .add-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--corner-full);
    background: var(--hue-primary);
    color: var(--hue-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease-fast);
}

.related-scroll .add-btn:hover {
    background: var(--hue-secondary);
}

.related-nav {
    display: flex;
    justify-content: center;
    gap: var(--gap-md);
    margin-top: var(--gap-xl);
}

.related-prev,
.related-next {
    width: 48px;
    height: 48px;
    border-radius: var(--corner-full);
    background: var(--hue-white);
    border: 1px solid var(--hue-border);
    color: var(--hue-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ease-fast);
    cursor: pointer;
}

.related-prev:hover,
.related-next:hover {
    background: var(--hue-primary);
    color: var(--hue-white);
    border-color: var(--hue-primary);
}

@media (max-width: 640px) {
    .related-scroll .item-tile {
        flex: 0 0 240px;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: var(--gap-md) 0;
    font-size: 0.875rem;
    color: var(--hue-text-muted);
}

.breadcrumbs a {
    color: var(--hue-text-light);
    transition: color var(--ease-fast);
}

.breadcrumbs a:hover {
    color: var(--hue-secondary);
}

.breadcrumbs .separator {
    margin: 0 var(--gap-sm);
}

.breadcrumbs .current {
    color: var(--hue-primary);
}

/* Stock Status */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: var(--gap-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: var(--gap-lg);
}

.stock-status.in-stock {
    color: var(--hue-success);
}

.stock-status.low-stock {
    color: var(--hue-secondary);
}

.stock-status.out-stock {
    color: var(--hue-error);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--corner-full);
    background: currentColor;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-wrapper {
        grid-template-columns: 1fr;
        gap: var(--gap-2xl);
    }
    
    .product-gallery {
        position: relative;
        top: 0;
    }
    
    .main-image img {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 640px) {
    .product-features {
        grid-template-columns: 1fr;
    }
    
    .tab-list {
        flex-wrap: wrap;
        gap: var(--gap-md);
    }
    
    .thumbnail-list {
        gap: var(--gap-sm);
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
}
