/* ==========================================
   PHASES 11-15: FINAL FEATURES
   ========================================== */

/* ==========================================
   PHASE 11: PERSONALIZATION
   ========================================== */

/* "You May Also Like" Section */
.recommendations-section {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 40px 0;
    margin: 40px 0;
    border-radius: 12px;
}

.recommendations-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.recommendations-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.recommendations-title {
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

.recommendations-subtitle {
    font-size: 14px;
    color: #666;
    margin-left: auto;
}

/* ==========================================
   PHASE 12: INTERACTIVE ELEMENTS
   ========================================== */

/* 360° Product Viewer */
.product-360-viewer {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
}

.product-360-viewer:active {
    cursor: grabbing;
}

.product-360-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.viewer-360-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 24px;
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.viewer-360-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s ease;
}

.viewer-360-btn:hover {
    transform: scale(1.2);
}

.viewer-360-indicator {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* AR Preview Button */
.ar-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ar-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.ar-preview-btn i {
    font-size: 20px;
}

/* Size Guide Modal */
.size-guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.size-guide-modal.show {
    display: flex;
}

.size-guide-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
}

.size-guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.size-guide-table th,
.size-guide-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.size-guide-table th {
    background: #f9fafb;
    font-weight: 700;
    color: #111;
}

/* Color/Size Selector */
.variant-selector {
    margin: 20px 0;
}

.variant-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-option {
    position: relative;
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #374151;
}

.variant-option:hover {
    border-color: var(--amazon-blue);
}

.variant-option.selected {
    border-color: var(--amazon-blue);
    background: rgba(20, 110, 180, 0.1);
    color: var(--amazon-blue);
}

.variant-option.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Live Chat Widget */
.live-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-toggle-btn i {
    font-size: 24px;
    color: white;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
}

.chat-window.show {
    display: flex;
}

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.chat-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

/* ==========================================
   PHASE 13: REVIEWS & RATINGS
   ========================================== */

/* Review System */
.reviews-section {
    margin: 40px 0;
}

.reviews-summary {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 32px;
}

.reviews-overall {
    text-align: center;
}

.reviews-overall-rating {
    font-size: 48px;
    font-weight: 900;
    color: #111;
    line-height: 1;
}

.reviews-overall-stars {
    font-size: 24px;
    color: #fbbf24;
    margin: 8px 0;
}

.reviews-overall-count {
    font-size: 14px;
    color: #666;
}

.reviews-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-breakdown-stars {
    font-size: 13px;
    color: #666;
    width: 60px;
}

.review-breakdown-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.review-breakdown-fill {
    height: 100%;
    background: #fbbf24;
    transition: width 0.5s ease;
}

.review-breakdown-count {
    font-size: 13px;
    color: #666;
    width: 40px;
    text-align: right;
}

/* Individual Review */
.review-item {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.review-author-name {
    font-weight: 700;
    color: #111;
}

.review-date {
    font-size: 13px;
    color: #9ca3af;
}

.review-rating {
    color: #fbbf24;
    font-size: 16px;
}

.review-content {
    color: #374151;
    line-height: 1.6;
    margin: 12px 0;
}

.review-images {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.review-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.review-image:hover {
    transform: scale(1.05);
}

.review-helpful {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.review-helpful-text {
    font-size: 14px;
    color: #666;
}

.review-helpful-btn {
    padding: 6px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-helpful-btn:hover {
    border-color: var(--amazon-blue);
    color: var(--amazon-blue);
}

.review-helpful-btn.active {
    background: var(--amazon-blue);
    color: white;
    border-color: var(--amazon-blue);
}

/* Write Review Form */
.write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--amazon-orange);
    color: #111;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.write-review-btn:hover {
    background: #e68900;
    transform: translateY(-2px);
}

.review-form {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.rating-input {
    display: flex;
    gap: 8px;
    font-size: 32px;
    margin: 16px 0;
}

.rating-input .star {
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rating-input .star.selected,
.rating-input .star:hover {
    color: #fbbf24;
}

/* ==========================================
   PHASE 14: ADVANCED SEARCH
   ========================================== */

/* Search Results Page */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.search-results-count {
    font-size: 18px;
    color: #666;
}

.search-results-count strong {
    color: #111;
    font-weight: 700;
}

/* Visual Search Results */
.search-visual-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    align-items: center;
}

.search-visual-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

/* Recent Searches */
.recent-searches {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.recent-searches-title {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.recent-search-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-search-item {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-search-item:hover {
    border-color: var(--amazon-blue);
    color: var(--amazon-blue);
}

/* ==========================================
   PHASE 15: EMAIL & NOTIFICATIONS
   ========================================== */

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    font-size: 24px;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* Email Subscription Popup */
.email-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 24px;
    z-index: 9997;
    display: none;
}

.email-popup.show {
    display: block;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.email-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 24px;
}

.email-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.email-popup-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.email-popup-form {
    display: flex;
    gap: 8px;
}

.email-popup-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.email-popup-submit {
    padding: 12px 24px;
    background: var(--amazon-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Browser Notification Permission */
.notification-permission {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    text-align: center;
    display: none;
}

.notification-permission.show {
    display: block;
}

.notification-permission-text {
    margin-bottom: 12px;
}

.notification-permission-btn {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}