/**
 * AAN Tienda - Product Detail Page Styles
 * Extracted from inline styles for better caching and maintainability
 * Follows AAN Solutions Frontend Standards
 */

/* Note: Design tokens imported from colors.css */

/* Breadcrumb Navigation */
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    min-height: 44px; /* Touch target */
    display: inline-flex;
    align-items: center;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-tertiary);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Product Detail Container */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-3xl);
}

/* Product Images Section */
.product-images-section {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.product-main-image-wrapper {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-md);
    aspect-ratio: 1;
}

.product-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-main-image:hover {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-xl);
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-sm);
}

.thumbnail-btn {
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1;
    overflow: hidden;
    min-width: 44px; /* Touch target */
    min-height: 44px;
}

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

.thumbnail-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-alpha);
}

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

/* Product Info Section */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.product-header {
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.category-icon {
    color: var(--primary-color);
}

.product-title {
    font-size: clamp(1.5rem, 4vw, 2rem); /* Fluid typography */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-tight);
}

.product-code {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
    margin-bottom: var(--space-md);
}

.product-short-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Price Section */
.product-price-section {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.price-display {
    margin-bottom: var(--space-sm);
}

.product-price {
    font-size: clamp(1.5rem, 3vw, 2rem); /* Fluid typography */
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-range {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-secondary);
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stock-text {
    font-size: var(--text-sm);
    font-weight: 500;
}

.stock-available {
    color: var(--success-color);
}

.stock-low {
    color: var(--warning-color);
}

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

/* Variation Selector */
.variation-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.attribute-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.attribute-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.selected-value {
    font-weight: 400;
    color: var(--primary-color);
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.color-swatch {
    width: 48px;
    height: 48px;
    min-width: 44px; /* Touch target minimum */
    min-height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.color-swatch.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-alpha);
}

.color-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.color-swatch.disabled::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--error);
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.color-name {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: bottom 0.2s;
    pointer-events: none;
    z-index: 10;
}

.color-swatch:hover .color-name {
    bottom: -1.75rem;
}

.attribute-select {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* Touch target */
}

.attribute-select:hover {
    border-color: var(--primary-color);
}

.attribute-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.attribute-select option:disabled {
    opacity: 0.5;
    color: var(--gray-500);
    background: var(--gray-100);
}

/* Quantity Selector */
.quantity-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.quantity-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-btn {
    width: 44px;
    height: 44px;
    min-width: 44px; /* Touch target */
    min-height: 44px;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input {
    width: 60px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    background: white;
}

.quantity-input:focus {
    outline: none;
}

/* Product Form Buttons */
.btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    font-size: var(--text-base);
    font-weight: 600;
    width: 100%;
    margin-top: var(--space-sm);
    min-height: 44px; /* Touch target */
}

.btn-icon {
    flex-shrink: 0;
}

.btn-continue-shopping {
    width: 100%;
    text-align: center;
    padding: var(--space-sm) var(--space-2xl);
    min-height: 44px; /* Touch target */
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Description Section */
.product-description-section {
    padding: var(--space-2xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.product-description-content {
    font-size: var(--text-base);
    line-height: var(--line-height-loose);
    color: var(--text-secondary);
}

/* Flash Alerts */
.alert {
    max-width: 1200px;
    margin: var(--space-md) auto;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.alert-error {
    background: var(--error-light);
    color: var(--error-dark);
    border: 1px solid var(--error);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success);
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .product-images-section {
        position: static;
    }

    .product-title {
        font-size: var(--text-xl);
    }

    .product-price {
        font-size: var(--text-xl);
    }

    .breadcrumb {
        font-size: var(--text-xs);
    }

    .breadcrumb-current {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-detail-container {
        padding: var(--space-lg) var(--space-md);
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
