/* ===== Product Page Enhancements ===== */

/* Notification System */
.product-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    max-width: 400px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-notification.success {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

.product-notification.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.product-notification.warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.product-notification.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 16px;
}

.notification-close {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.3s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--product-border-light);
    border-top: 4px solid var(--product-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 10px;
    color: var(--product-text-muted);
    font-size: 14px;
    font-weight: 600;
}

/* Enhanced Hover Effects */
.interactive-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.interactive-element::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
}

.interactive-element:hover::before {
    width: 300px;
    height: 300px;
}

.interactive-element:active {
    transform: scale(0.98);
}

/* Enhanced Button Animations */
.action-button {
    position: relative;
    overflow: hidden;
}

.action-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-button:active::after {
    width: 300px;
    height: 300px;
}

/* Enhanced Gallery Effects */
.gallery-thumb {
    position: relative;
    overflow: hidden;
}

.gallery-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(76, 175, 80, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumb:hover::before {
    opacity: 1;
}

.gallery-thumb.active::before {
    opacity: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(76, 175, 80, 0.4) 100%);
}

/* Enhanced Main Image */
.main-image-container {
    position: relative;
    overflow: hidden;
}

.main-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%) skewX(-15deg);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.main-image-container:hover::after {
    transform: translateX(100%) skewX(-15deg);
}

/* Enhanced Price Animation */
.price-current {
    position: relative;
    overflow: hidden;
}

.price-current.updating {
    animation: priceUpdate 0.5s ease-in-out;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--product-primary); }
    100% { transform: scale(1); }
}

/* Enhanced Variant Selection */
.variant-option {
    position: relative;
    overflow: hidden;
}

.variant-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.3), transparent);
    transition: left 0.5s ease;
}

.variant-option:hover::before {
    left: 100%;
}

.variant-option.active {
    animation: variantSelect 0.4s ease-out;
}

@keyframes variantSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Enhanced Tab Animation */
.tab-pane {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.tab-pane.active {
    opacity: 1;
    transform: translateY(0);
}

.tab-item {
    position: relative;
}

.tab-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--product-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.tab-item.active::before {
    width: 100%;
}

/* Enhanced Quantity Controls */
.quantity-controls {
    position: relative;
    overflow: hidden;
}

.quantity-btn {
    position: relative;
    overflow: hidden;
}

.quantity-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(76, 175, 80, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.quantity-btn:hover::before {
    width: 40px;
    height: 40px;
}

/* Enhanced Feature Items */
.feature-item {
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.1), transparent);
    transition: left 0.6s ease;
}

.feature-item:hover::before {
    left: 100%;
}

/* Enhanced Stock Status */
.stock-status {
    position: relative;
    overflow: hidden;
}

.stock-status.in-stock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    animation: stockPulse 2s ease-in-out infinite;
}

@keyframes stockPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Enhanced Product Badges */
.product-badge {
    position: relative;
    overflow: hidden;
}

.product-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: badgeShine 3s linear infinite;
}

@keyframes badgeShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Theme Toggle */
.theme-toggle-btn {
    background: var(--product-card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--product-border-light);
}

.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.theme-toggle-btn:hover::before {
    width: 60px;
    height: 60px;
}

.theme-toggle-btn i {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.theme-toggle-btn:hover i {
    transform: scale(1.1);
}

/* Enhanced Sidebar */
.product-sidebar {
    position: relative;
}

.product-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--product-gradient-primary);
    border-radius: inherit;
    z-index: -1;
    transition: all 0.3s ease;
}

.product-sidebar:hover::before {
    transform: scale(1.02);
    box-shadow: var(--product-card-hover);
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--product-bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--product-primary);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--product-primary-dark);
}

/* Enhanced Selection */
::selection {
    background: rgba(76, 175, 80, 0.3);
    color: var(--product-text-primary);
}

::-moz-selection {
    background: rgba(76, 175, 80, 0.3);
    color: var(--product-text-primary);
}

/* Enhanced Focus States */
.action-button:focus,
.variant-option:focus,
.quantity-btn:focus,
.tab-item:focus,
.gallery-thumb:focus {
    outline: 2px solid var(--product-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

/* Enhanced Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--product-bg-secondary) 25%, var(--product-bg-tertiary) 50%, var(--product-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Text Animations */
.animated-text {
    overflow: hidden;
    position: relative;
}

.animated-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.4), transparent);
    animation: textShine 2s ease-in-out infinite;
}

@keyframes textShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Mobile Sticky Footer */
.mobile-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--product-card-bg);
    border-top: 1px solid var(--product-border-light);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .mobile-sticky-footer {
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
}

.mobile-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    max-width: 100%;
}

.mobile-price-section {
    flex: 1;
    min-width: 0;
}

.mobile-price-original {
    font-size: 12px;
    color: var(--product-text-muted);
    text-decoration: line-through;
    line-height: 1.2;
}

.mobile-price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--product-primary);
    line-height: 1.3;
}

.mobile-discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    margin-top: 2px;
}

.mobile-stock-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    margin-top: 4px;
}

.mobile-stock-status.in-stock {
    color: var(--product-success);
}

.mobile-stock-status.out-of-stock {
    color: var(--product-error);
}

.mobile-stock-status i {
    font-size: 10px;
}

.mobile-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mobile-wishlist-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--product-card-bg);
    border: 2px solid var(--product-border-light);
    color: var(--product-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-wishlist-btn:hover {
    border-color: var(--product-primary);
    color: var(--product-primary);
    transform: scale(1.05);
}

.mobile-wishlist-btn.liked {
    color: #e91e63;
    border-color: #e91e63;
}

.mobile-add-to-cart-btn,
.mobile-notify-btn {
    min-width: 140px;
    height: 45px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-add-to-cart-btn span,
.mobile-notify-btn span {
    font-size: 13px;
}

.mobile-add-to-cart-btn i,
.mobile-notify-btn i {
    font-size: 16px;
}

/* Mobile Footer Animation */
.mobile-sticky-footer.hidden {
    transform: translateY(100%);
}

.mobile-sticky-footer.show {
    transform: translateY(0);
    animation: slideUpBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUpBounce {
    0% {
        transform: translateY(100%);
    }
    60% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Success pulse animation for mobile footer */
.mobile-sticky-footer.success-pulse {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% {
        background: var(--product-card-bg);
        transform: scale(1);
    }
    50% {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(46, 125, 50, 0.1));
        transform: scale(1.02);
        box-shadow: 0 -8px 25px rgba(76, 175, 80, 0.3);
    }
    100% {
        background: var(--product-card-bg);
        transform: scale(1);
    }
}

/* Body padding for mobile footer */
@media (max-width: 991px) {
    body {
        padding-bottom: 80px;
    }
}

/* Enhanced Mobile Optimizations */
@media (max-width: 768px) {
    .product-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        border-radius: 8px;
        padding: 12px 15px;
        font-size: 13px;
        bottom: 100px; /* Space for sticky footer */
    }
    
    .notification-close {
        top: 3px;
        left: 3px;
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .theme-toggle-container {
        top: 10px;
        left: 10px;
    }
    
    .theme-toggle-btn {
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle-btn i {
        font-size: 16px;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    .interactive-element:hover::before {
        width: 200px;
        height: 200px;
    }
    
    /* Hide desktop action buttons on mobile */
    .product-sidebar .action-buttons {
        display: none;
    }
    
    /* Adjust mobile footer for very small screens */
    .mobile-footer-content {
        flex-direction: row;
        align-items: center;
    }
    
    .mobile-price-section {
        text-align: right;
    }
}

@media (max-width: 480px) {
    .mobile-footer-content {
        padding: 0;
        gap: 10px;
    }
    
    .mobile-price-current {
        font-size: 14px;
    }
    
    .mobile-price-original {
        font-size: 11px;
    }
    
    .mobile-add-to-cart-btn,
    .mobile-notify-btn {
        min-width: 120px;
        height: 40px;
        font-size: 12px;
    }
    
    .mobile-add-to-cart-btn span,
    .mobile-notify-btn span {
        font-size: 12px;
    }
    
    .mobile-wishlist-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .mobile-sticky-footer {
        padding: 10px;
    }
}

/* Enhanced Dark Mode Adjustments */
[data-theme="dark"] .product-notification {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .interactive-element::before {
    background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, transparent 70%);
}

[data-theme="dark"] .action-button::after {
    background: rgba(76, 175, 80, 0.3);
}

[data-theme="dark"] .gallery-thumb::before {
    background: linear-gradient(135deg, transparent 0%, rgba(76, 175, 80, 0.3) 100%);
}

[data-theme="dark"] .gallery-thumb.active::before {
    background: linear-gradient(135deg, transparent 0%, rgba(76, 175, 80, 0.5) 100%);
}

[data-theme="dark"] .main-image-container::after {
    background: linear-gradient(45deg, transparent 30%, rgba(76, 175, 80, 0.1) 50%, transparent 70%);
}

/* Enhanced Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .product-notification {
        border: 2px solid currentColor;
    }
    
    .action-button {
        border: 2px solid currentColor;
    }
    
    .variant-option {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .product-notification,
    .theme-toggle-container,
    .gallery-controls,
    .action-buttons {
        display: none !important;
    }
    
    .product-page {
        background: white !important;
        color: black !important;
    }
    
    .product-sidebar {
        position: static !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
} 