/**
 * Products Frontend Styles
 * 
 * Styles for public product pages and review forms
 * @package Xeora
 * @subpackage Products
 * @version 1.1.0 - Fix CSS conflicts with Xeora header
 */

/* ================================================
   BASE RESET & TYPOGRAPHY
   ================================================ */

/* ✅ Scope reset to avoid conflicting with header */
.xeora-product-container * {
    box-sizing: border-box;
}

.xeora-product-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ================================================
   PUBLIC PRODUCT ARCHIVE / CATALOG
   ================================================ */

.xeora-products-archive-container {
    max-width: 1280px;
}

.xeora-products-archive-header {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-products-archive-kicker {
    display: inline-block;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 8px;
}

.xeora-products-archive-header h1 {
    font-size: 34px;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.xeora-products-archive-header p {
    color: #666;
    margin: 0;
}

.xeora-products-archive-current {
    margin-top: 16px;
    color: #555;
}

.xeora-products-archive-toolbar {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-products-archive-search {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.xeora-products-archive-search input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
}

.xeora-products-archive-submit {
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: #fff;
    padding: 0 18px;
    font-weight: 600;
    cursor: pointer;
}

.xeora-products-archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.xeora-products-archive-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #333;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.xeora-products-archive-filter span {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 12px;
}

.xeora-products-archive-filter:hover,
.xeora-products-archive-filter.active {
    background: #667eea;
    color: #fff;
}

.xeora-products-archive-filter.active span {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.xeora-products-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    transition: opacity 0.2s ease;
}

.xeora-products-archive-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-products-archive-image {
    display: block;
    height: 210px;
    background: #f3f4f6;
    overflow: hidden;
}

.xeora-products-archive-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xeora-products-archive-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 54px;
}

.xeora-products-archive-card-body {
    padding: 18px;
}

.xeora-products-archive-category {
    display: inline-block;
    color: #667eea;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.xeora-products-archive-card h2 {
    font-size: 19px;
    margin: 0 0 8px;
    line-height: 1.3;
}

.xeora-products-archive-card h2 a {
    color: #1a1a1a;
    text-decoration: none;
}

.xeora-products-archive-brand {
    color: #667eea;
    font-weight: 600;
    margin: 0 0 8px;
}

.xeora-products-archive-description {
    color: #666;
    margin: 0 0 16px;
}

.xeora-products-archive-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.xeora-products-archive-price {
    font-size: 18px;
    color: #1a1a1a;
}

.xeora-products-archive-link {
    color: #667eea;
    font-weight: 700;
    text-decoration: none;
}

.xeora-products-archive-empty {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-products-archive-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* ================================================
   CONTAINER & LAYOUT
   ================================================ */

.xeora-product-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    /* ✅ Add top margin for fixed header */
    margin-top: 80px;
}

/* ================================================
   PRODUCT HEADER
   ================================================ */

.xeora-product-header {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-product-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.xeora-product-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.xeora-product-placeholder {
    background: #f0f0f0;
    height: 400px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 48px;
}

/* ================================================
   PRODUCT INFO
   ================================================ */

.xeora-product-info h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.xeora-product-brand {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 18px;
}

.xeora-product-brand::before {
    content: '🏷️ ';
}

/* ================================================
   RATING DISPLAY
   ================================================ */

.xeora-rating-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.xeora-stars {
    font-size: 24px;
    color: #ffc107;
}

.xeora-rating-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.xeora-rating-count {
    color: #666;
    font-size: 14px;
}

.xeora-product-description {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
}

/* ================================================
   REVIEWS SECTION
   ================================================ */

.xeora-reviews-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-reviews-section h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.xeora-review-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

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

.xeora-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.xeora-review-author {
    font-weight: 600;
    color: #333;
}

.xeora-review-author::before {
    content: '👤 ';
}

.xeora-review-date {
    font-size: 14px;
    color: #999;
}

.xeora-review-rating {
    color: #ffc107;
    font-size: 18px;
    margin-bottom: 10px;
}

.xeora-review-text {
    color: #555;
    line-height: 1.6;
}

.xeora-no-reviews {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ================================================
   REVIEW FORM
   ================================================ */

.xeora-review-form {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.xeora-review-form h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.xeora-login-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    color: #856404;
}

.xeora-login-notice a {
    color: #667eea;
    font-weight: 600;
    text-decoration: underline;
}

.xeora-form-group {
    margin-bottom: 20px;
}

.xeora-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.xeora-form-group input,
.xeora-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.xeora-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.xeora-form-group input:focus,
.xeora-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* ================================================
   STAR RATING INPUT (Interactive)
   ================================================ */

.xeora-star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    justify-content: flex-end;
}

.xeora-star-rating-input input[type="radio"] {
    display: none;
}

.xeora-star-rating-input label {
    font-size: 40px;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
    padding: 0;
}

.xeora-star-rating-input label:before {
    content: '☆';
}

/* Hover effect - fills stars */
.xeora-star-rating-input label:hover:before,
.xeora-star-rating-input label:hover ~ label:before {
    content: '★';
    color: #ffc107;
    transform: scale(1.1);
}

/* Checked effect - keeps stars filled */
.xeora-star-rating-input input[type="radio"]:checked ~ label:before {
    content: '★';
    color: #ffc107;
}

/* ================================================
   BUTTONS
   ================================================ */

.xeora-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.xeora-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.xeora-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ================================================
   ALERTS
   ================================================ */

.xeora-alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.xeora-alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.xeora-alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.xeora-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
    .xeora-product-container {
        margin-top: 60px;
        padding: 20px 15px;
    }
    
    .xeora-product-grid {
        grid-template-columns: 1fr;
    }
    
    .xeora-product-header {
        padding: 20px;
    }
    
    .xeora-reviews-section,
    .xeora-review-form {
        padding: 20px;
    }
    
    .xeora-product-info h1 {
        font-size: 24px;
    }
}

@media (max-width: 1024px) {
    .xeora-products-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .xeora-products-archive-header,
    .xeora-products-archive-toolbar {
        padding: 20px;
    }

    .xeora-products-archive-header h1 {
        font-size: 26px;
    }

    .xeora-products-archive-grid {
        grid-template-columns: 1fr;
    }

    .xeora-products-archive-search {
        flex-direction: column;
    }

    .xeora-products-archive-filters {
        gap: 8px;
    }

    .xeora-products-archive-filter {
        padding: 7px 12px;
        font-size: 13px;
    }
}
