/**
 * Product Detail Page Styles
 * Matches the Premium Tech Design System
 */

/* ========================================
   VARIABLES LINKED TO THEME
======================================== */
:root {
    --detail-bg-hero: #f8f9fa;
    /* Consistent with products.php */
    --detail-card-bg: #ffffff;
    --detail-text-dark: #1e293b;
    --detail-text-muted: #64748b;
    --detail-radius: 16px;
    --detail-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ========================================
   GALLERY & HERO
======================================== */
.product-detail-hero {
    /* Removed aggressive gradient to match clean look */
    background: var(--detail-bg-hero);
    padding: 30px 0;
    margin-bottom: 30px;
}

.product-gallery {
    position: relative;
    background: var(--detail-card-bg);
    border-radius: var(--detail-radius);
    padding: 20px;
    box-shadow: var(--detail-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square for premium feel */
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure product is fully visible */
    object-position: center;
    transition: transform 0.3s ease;
    padding: 20px;
}

.main-image-container:hover .main-image {
    transform: scale(1.05);
}

/* Navigation Buttons */
.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.image-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.image-nav-btn.prev {
    left: 15px;
}

.image-nav-btn.next {
    right: 15px;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.fullscreen-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* Thumbnails */
.thumbnail-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}

.thumbnail:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(10, 71, 163, 0.2);
}

/* ========================================
   PRODUCT INFO
======================================== */
.product-info-card {
    background: var(--detail-card-bg);
    border-radius: var(--detail-radius);
    padding: 30px;
    box-shadow: var(--detail-shadow);
    position: sticky;
    top: 90px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--detail-text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    /* Updated to variable */
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--detail-text-muted);
    font-weight: 500;
}

.meta-item i {
    color: var(--secondary-color);
}

.rating-display {
    background: #fffbeb;
    padding: 4px 12px;
    border-radius: 20px;
    color: #b45309;
}

/* ========================================
   ACTION BUTTONS
======================================== */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-buy-now {
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0A47A3 0%, #1E90FF 100%);
    /* Matched to products.css */
    border: none;
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(10, 71, 163, 0.3);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-buy-now:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(10, 71, 163, 0.4);
    color: white;
}

.btn-add-cart-new {
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    background: #eff6ff;
    /* Light blue tint */
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-cart-new:hover {
    background: #dbeafe;
    transform: translateY(-2px);
    color: #003d99;
}

.btn-demo {
    padding: 12px;
    font-weight: 600;
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: var(--detail-text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-demo:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f8fafc;
}

/* ========================================
   RELATED PRODUCTS
======================================== */
.product-card-small {
    background: var(--detail-card-bg);
    border-radius: var(--detail-radius);
    overflow: hidden;
    box-shadow: var(--detail-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
}

.product-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card-small img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f8fafc;
    padding: 1rem;
}

.product-card-small .card-body {
    padding: 1.25rem;
}

.product-card-small .card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--detail-text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-small .card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   DESCRIPTION & REVIEWS
======================================== */
.product-description,
.ratings-section {
    background: var(--detail-card-bg);
    border-radius: var(--detail-radius);
    padding: 30px;
    box-shadow: var(--detail-shadow);
    margin-top: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-description h3,
.ratings-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--detail-text-dark);
    margin-bottom: 20px;
}

.product-description p {
    line-height: 1.8;
    color: var(--detail-text-muted);
    font-size: 1.05rem;
}

/* Review Cards */
.rating-summary-card,
.rating-form-card,
.reviews-list-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    height: 100%;
}

.review-item {
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.reviewer-name {
    font-weight: 700;
    color: var(--detail-text-dark);
}

/* ========================================
   FULLSCREEN MODAL
======================================== */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.fullscreen-modal.active {
    display: flex;
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

/* ========================================
   NOTIFICATIONS
======================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-weight: 600;
    border-left: 5px solid;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    border-color: #10b981;
}

.notification-error {
    border-color: #ef4444;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .container.py-5 {
        padding-top: 20px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-price {
        font-size: 2rem;
    }

    .action-buttons-grid {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 100;
        margin: 0;
        gap: 10px;
    }

    body {
        padding-bottom: 100px;
        /* Space for fixed buttons */
    }

    .main-image-container {
        border-radius: 0;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }
}