/* ===== PRODUCT PAGE CSS ===== */

.product-page {
    --product-primary: var(--primary-color, #1a3a5c);
    --product-secondary: var(--secondary-color, #2c5282);
    --product-success: var(--success-color, #10b981);
    --product-price: var(--price-color, #059669);
}

/* Variant Selector */
.variant-selector {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.variant-selector-title {
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-option {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.variant-option:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.variant-option.selected {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
}

.variant-option .variant-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.variant-option .variant-price {
    font-size: 0.7rem;
    margin-top: 3px;
}

.variant-option.selected .variant-price {
    color: rgba(255,255,255,0.9);
}

.variant-option .variant-stock {
    font-size: 0.65rem;
    margin-top: 2px;
    color: #64748b;
}

.variant-option.selected .variant-stock {
    color: rgba(255,255,255,0.8);
}

.variant-option.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.variant-option.out-of-stock .variant-name {
    text-decoration: line-through;
}

/* Hero Gallery - Smart Image Fitting */
.product-gallery {
    position: relative;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.main-image-container {
    position: relative;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

/* Smart Image Fitting - default contain pentru imagini cu dimensiuni nestandard */
.main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Imagini wide (landscape) - fill width */
.main-image.fit-wide {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

/* Imagini tall (portrait) - fill height */
.main-image.fit-tall {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Imagini patrate sau aproape patrate - cover pentru fill */
.main-image.fit-square {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Imagini standard (aspect ratio ~1.5:1 pana la 2:1) - cover partial */
.main-image.fit-standard {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Loading state */
.main-image.loading {
    opacity: 0.5;
}

.main-image:hover {
    transform: scale(1.03);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--product-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav:hover {
    background: var(--product-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }

.thumbnail-strip {
    display: flex;
    gap: 10px;
    padding: 14px;
    overflow-x: auto;
    background: rgba(0,0,0,0.02);
}

.thumbnail-strip::-webkit-scrollbar {
    height: 5px;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
    background: var(--product-primary);
    border-radius: 3px;
}

.thumb-item {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
}

.thumb-item.active {
    border-color: var(--product-primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.thumb-item:hover {
    transform: translateY(-2px);
}

/* Thumbnail - always cover for consistent grid */
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item.video-thumb {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-item.video-thumb i {
    font-size: 1.5rem;
    color: #fff;
}

/* Badges */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.badge-item {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.badge-discount {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.badge-variants {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
}

.badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

/* Product Info */
.product-info-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
    height: 100%;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-secondary) 100%);
    color: #fff;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.product-sku {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Rating */
.rating-display {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: #fbbf24;
    font-size: 0.9rem;
}

.stars i.empty {
    color: #e5e7eb;
}

.rating-text {
    color: #64748b;
    font-size: 0.75rem;
}

/* Price Section */
.price-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--product-price);
    line-height: 1;
}

.old-price {
    font-size: 1.1rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 10px;
}

.discount-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ef4444;
    color: #fff;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 10px;
}

.price-per-unit {
    color: #64748b;
    font-size: 0.7rem;
    margin-top: 6px;
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

.stock-status.in-stock {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
}

.stock-status.low-stock {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}

.stock-status.out-of-stock {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
}

.stock-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.in-stock .stock-icon {
    background: #10b981;
    color: #fff;
}

.low-stock .stock-icon {
    background: #f59e0b;
    color: #fff;
}

.out-of-stock .stock-icon {
    background: #ef4444;
    color: #fff;
}

/* Short Description */
.short-description {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Quick Features */
.quick-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1.25rem;
}

.quick-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #475569;
}

.quick-feature i {
    font-size: 1rem;
    color: var(--product-primary);
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.qty-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--product-primary);
    color: #fff;
}

.qty-input {
    width: 50px;
    height: 38px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.btn-add-to-cart {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--product-success) 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-add-to-cart:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-wishlist {
    width: 48px;
    height: 48px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-wishlist:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.trust-badge {
    text-align: center;
    padding: 12px 8px;
    background: #f8fafc;
    border-radius: 10px;
}

.trust-badge i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    display: block;
}

.trust-badge .bi-truck { color: #3b82f6; }
.trust-badge .bi-shield-check { color: #10b981; }
.trust-badge .bi-arrow-repeat { color: #8b5cf6; }

.trust-badge span {
    font-size: 0.65rem;
    color: #64748b;
    display: block;
}

/* Product Details Tabs */
.product-details-section {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-top: 1.5rem;
}

.details-tabs {
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--product-primary);
    transition: width 0.3s ease;
    border-radius: 2px 2px 0 0;
}

.tab-btn:hover {
    color: var(--product-primary);
    background: rgba(255,255,255,0.5);
}

.tab-btn.active {
    color: var(--product-primary);
    background: #fff;
}

.tab-btn.active::after {
    width: 50px;
}

.tab-content {
    padding: 1.5rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Description Tab */
.description-content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #475569;
}

.description-content p {
    margin-bottom: 0.75rem;
}

/* Features Tab */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.feature-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}

.feature-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.feature-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 3px;
}

.feature-content p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}

/* Specifications Tab */
.specs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

.specs-table tr {
    transition: background 0.2s ease;
}

.specs-table tr:hover {
    background: #f8fafc;
}

.specs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.specs-table td:first-child {
    font-weight: 600;
    color: #374151;
    width: 40%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.specs-table td:first-child i {
    color: var(--product-primary);
    font-size: 0.95rem;
}

.specs-table td:last-child {
    color: #64748b;
}

/* Video Tab */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Related Products - Carduri mai inalte pentru poze mai bune */
.related-section {
    margin-top: 2.75rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.related-card img {
    width: 100%;
    height: 200px; /* Marit de la 155px */
    object-fit: cover;
}

.related-card-body {
    padding: 1rem;
}

.related-card h6 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.related-card .price {
    font-weight: 700;
    color: var(--product-price);
    font-size: 1.1rem;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

/* Reviews Section */
.reviews-section {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.avg-rating {
    text-align: center;
}

.avg-rating .big-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.avg-rating .stars {
    margin-top: 0.4rem;
}

.avg-rating .total {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.review-card {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.reviewer-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.85rem;
}

.reviewer-date {
    font-size: 0.7rem;
    color: #94a3b8;
}

.review-rating .stars i {
    font-size: 0.85rem;
}

.review-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.review-comment {
    color: #475569;
    line-height: 1.6;
    font-size: 0.8rem;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #dcfce7;
    color: #16a34a;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
}

.admin-reply {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border-left: 3px solid var(--product-primary);
    border-radius: 0 10px 10px 0;
}

.admin-reply-header {
    font-weight: 600;
    color: var(--product-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
}

/* Review Form */
.review-form-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.star-rating-input {
    display: flex;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.star-rating-input i {
    font-size: 1.6rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating-input i:hover,
.star-rating-input i.active {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 992px) {
    .main-image-container { height: 320px; }
    .product-title { font-size: 1.3rem; }
    .current-price { font-size: 1.6rem; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .trust-badges { grid-template-columns: repeat(3, 1fr); }
    .variant-option { min-width: 85px; }
}

@media (max-width: 768px) {
    .main-image-container { height: 250px; }
    .product-info-card { padding: 1.25rem; }
    .quick-features { grid-template-columns: 1fr; }
    .action-buttons { flex-direction: column; }
    .btn-wishlist { width: 100%; height: 42px; }
    .trust-badges { grid-template-columns: 1fr; }
    .details-tabs { flex-wrap: nowrap; }
    .tab-btn { min-width: 100px; padding: 12px 14px; font-size: 0.75rem; }
    .variant-options { flex-direction: column; }
    .variant-option { min-width: 100%; }
}
