/* PromptifyArt - Product Detail Page with Enhanced Gallery */
:root {
    /* Primary Colors */
    --color-primary: #8b5cf6;
    --color-primary-light: #a78bfa;
    --color-primary-dark: #7c3aed;
    
    /* Background Colors */
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-dark: #0f172a;
    
    /* Text Colors */
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-lighter: #94a3b8;
    --color-text-inverse: #ffffff;
    
    /* Parameter Colors */
    --color-param-bg: #1e293b;
    --color-param-text: #e2e8f0;
    --color-param-key: #60a5fa;
    --color-param-value: #34d399;
    --color-param-border: #334155;
    
    /* Transitions */
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

/* Base Styles */
.promptifyart-detail-container {
    background: var(--color-bg);
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.desktop-only { display: block; }
.mobile-only { display: none; }

/* Breadcrumb Navigation */
.breadcrumb-nav {
    padding: 1.5rem 0;
}

.breadcrumb-nav ol {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.breadcrumb-nav a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-nav a:hover {
    color: var(--color-primary);
}

.breadcrumb-nav li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    opacity: 0.5;
}

/* Main Grid Layout */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

/* Enhanced Gallery Section */
.enhanced-gallery {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-bg-dark);
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    transition: transform var(--transition-base);
    width: 100%;
    height: 100%;
    flex-direction: column; /* Default PC layout */
}

.gallery-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-dark);
}

.slide-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-slide.active .slide-image img {
    transform: scale(1.02);
}

/* Gallery Controls */
.gallery-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
    z-index: 10;
}

.gallery-control {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-md);
}

.gallery-control:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.gallery-control:active {
    transform: scale(0.95);
}

.gallery-control svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-text);
}

/* Gallery Indicator */
.gallery-indicator {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Scroll/Swipe Hints */
.scroll-hint,
.swipe-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
    animation: fadeInOut 3s ease-in-out;
    z-index: 10;
}

.scroll-hint svg,
.swipe-hint svg {
    width: 16px;
    height: 16px;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Product Info Section */
.product-header {
    margin-bottom: 2rem;
}

.category-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.category-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: transform var(--transition-fast);
}

.category-badge.primary {
    background: linear-gradient(135deg, var(--badge-color, var(--color-primary)) 0%, 
                                      color-mix(in srgb, var(--badge-color, var(--color-primary)) 70%, white) 100%);
    color: white;
}

.category-badge.secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border); /* Assumed var, fallback needed if not defined */
}

.category-badge.commercial {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.category-badge svg {
    width: 14px;
    height: 14px;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.product-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
}

.stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.star.half {
    opacity: 0.5;
}

.rating-value {
    font-weight: 600;
    color: var(--color-text);
}

.views svg {
    color: var(--color-text-lighter);
}

/* Critical Content Section */
.critical-content-section {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.structured-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.structured-summary strong {
    color: var(--color-text);
    font-weight: 600;
}

.detailed-description {
    line-height: 1.7;
    color: var(--color-text);
    font-size: 1.125rem;
}

.detailed-description p {
    margin-bottom: 1.5rem;
}

.structure-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 0.75rem;
    color: white;
}

.structure-summary h3 {
    color: white;
    margin-bottom: 1rem;
}

.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.structure-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

/* Pricing Section */
.pricing-section {
    position: sticky;
    top: 2rem;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #e2e8f0; /* Fallback for color-border */
    margin-bottom: 2rem;
}

.price-display {
    margin-bottom: 1.5rem;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.amount {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.free-tag {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-note {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--color-text);
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-secondary.active {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    border-color: #ef4444;
}

.btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

/* Keywords Section */
.keywords-section {
    margin: 2rem 0;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.keyword-tag {
    background: var(--color-bg-alt);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    border: 1px solid transparent;
}

.keyword-tag:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* Detailed Info Tabs */
.detailed-info-tabs {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: var(--color-bg-alt);
}

.tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab:hover {
    color: var(--color-primary);
    background: rgba(139, 92, 246, 0.05);
}

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

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.tabs-content {
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text);
}

/* Parameter List */
.parameter-list {
    background: var(--color-param-bg);
    color: var(--color-param-text);
    padding: 1.5rem;
    border-radius: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

.parameter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-param-border);
}

.parameter-item:last-child {
    border-bottom: none;
}

.param-key {
    color: var(--color-param-key);
    font-weight: 600;
}

.param-value {
    color: var(--color-param-value);
}

.parameter-raw {
    color: var(--color-param-text);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Usage Steps */
.usage-steps {
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.usage-steps li {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--color-text);
}

.usage-steps strong {
    color: var(--color-primary);
}

/* License Info */
.license-info {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
    border-left: 4px solid #f59e0b;
}

.license-info h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.license-info p {
    color: #92400e;
    margin: 0;
}

/* Related Products Section */
.related-products-section {
    padding: 4rem 0;
    background: var(--color-bg-alt);
    margin-top: 4rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.view-all:hover {
    color: var(--color-primary-dark);
    gap: 0.75rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-xl);
}

.related-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-bg-dark);
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.free-label {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.related-content {
    padding: 1.5rem;
}

.related-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
    line-height: 1.4;
}

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

.related-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.related-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.related-rating svg {
    width: 14px;
    height: 14px;
    color: #fbbf24;
}

.sales {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Loading state */
.btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Consolidated Media Queries */
@media (max-width: 1024px) {
    .detail-grid {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-container {
        height: 400px;
    }

    .gallery-track {
        flex-direction: row; /* Mobile layout */
    }

    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }

    .product-title {
        font-size: 2rem;
    }

    .pricing-section {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .gallery-container {
        height: 350px;
    }
    
    .gallery-control {
        width: 40px;
        height: 40px;
    }
    
    .gallery-control svg {
        width: 20px;
        height: 20px;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .trust-badges {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
    }
}
