:root {
    --gold: #D4AF37;
    --light-gold: #F5E6A3;
    --beige: #F5F5DC;
    --dark-beige: #E6D8B5;
    --black: #1a1a1a;
}

/* Pagination Styling */
.pagination {
    gap: 5px;
}

.page-item .page-link {
    border: 2px solid #DAA520;
    color: #5D4037;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.page-item .page-link:hover {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-color: #B8860B;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #DAA520 0%, #B8860B 100%);
    border-color: #B8860B;
    color: white;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.3);
}

.page-item.disabled .page-link {
    background: #f0f0f0;
    border-color: #ddd;
    color: #999;
}


/* Search Container - Inside navbar next to icon */
#searchContainer {
    display: none;
}

#searchContainer.show {
    display: block;
}

/* Add spacing to navbar icons when search is active */
.d-flex.align-items-center.position-relative.search-active #userToggle,
.d-flex.align-items-center.position-relative.search-active > a {
    margin-right: 250px;
    transition: margin-right 0.3s ease;
}

/* User Menu */
#userMenu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

#userMenu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#userMenu a {
    padding: 12px 20px;
    display: block;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
}

#userMenu a:hover {
    background: #f8f9fa;
    color: #D4AF37;
}

/* Responsive Pagination */
@media (max-width: 576px) {
    .pagination {
        font-size: 14px;
    }

    .page-item .page-link {
        padding: 8px 12px;
    }
}

/* Product Details Images */
.product-details .main-image {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFFBF0 100%);
}

.product-details .main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 15px;
}

.product-details .main-image:hover img {
    transform: scale(1.03);
}

/* Image Zoom Overlay */
.image-zoom-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.8) 0%, rgba(184, 134, 11, 0.8) 100%);
    color: white;
    padding: 10px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.main-image:hover .image-zoom-overlay {
    opacity: 1;
    transform: scale(1.1);
}

/* Thumbnail Images */
.thumbnail-img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 5px;
    background: #fff;
}

.thumbnail-img:hover {
    border-color: #DAA520;
    transform: scale(1.05);
    opacity: 0.8;
}

.thumbnail-img.active {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.2);
}

/* Product Info */
.product-info {
    padding: 15px 0;
}

/* Product Info Container - Unified Background */
.product-info-container {
    background: linear-gradient(145deg, #faf8f5 0%, #f5f0e8 100%);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

.product-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #5d4e37;
}

/* Product Info Container Headings */
.product-info-container h1,
.product-info-container h2,
.product-info-container h5 {
    color: #5d4e37;
}

/* Product Info Container Icons */
.product-info-container i.text-warning {
    color: #D4AF37 !important;
    font-size: 1.5rem;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product Details Icons Spacing */
.product-info-container .d-flex.align-items-center {
    gap: 1rem;
}

.product-rating .stars {
    font-size: 1rem;
}

.product-price .current-price {
    font-size: 1.6rem;
    font-weight: 800;
}

.product-price .original-price {
    color: #A0826D;
    font-size: 1.2rem;
}

.discount-badge {
    background: linear-gradient(135deg, #DAA520 0%, #B8860B 100%) !important;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
}

/* Quantity Selector */
.quantity-selector .form-control {
    border: 2px solid #DAA520 !important;
    text-align: center;
    font-weight: 600;
    padding-left: 0;
}

.quantity-selector .btn {
    border: 2px solid #DAA520 !important;
    color: var(--primary-gold);
    font-weight: 600;
}

/* RTL Border Radius Fix for Quantity Selector */
[dir="rtl"] .quantity-selector .btn:first-child {
    /* زر النقصان - يمين */
    border-radius: 0 8px 8px 0 !important;
}

[dir="rtl"] .quantity-selector .btn:last-child {
    /* زر الزيادة - شمال */
    border-radius: 8px 0 0 8px !important;
}

.quantity-selector .btn:hover {
    background: #DAA520 !important;
    color: white;
}

/* Product Info Cards */
.card-pro {
    background: linear-gradient(145deg, #faf8f5 0%, #f5f0e8 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.05);
}

.card-pro:hover {
    border-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

.card-pro li {
    padding: 6px 0;
    color: #5d4e37 !important;
}

.card-pro i {
    color: #D4AF37 !important;
    font-size: 1.2rem;
}

/* Reviews Section */
.review-item {
    background: linear-gradient(145deg, #ffffff 0%, #fffbf5 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.08);
}

.review-item:hover {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.15);
}

.review-item .stars {
    color: var(--primary-gold);
}

/* Related Products */
.related-products .product-card {
    height: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-details .main-image img {
        height: 300px;
    }

    .thumbnail-img {
        height: 60px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-price .current-price {
        font-size: 1.5rem;
    }

    .product-description {
        padding: 20px;
        margin-top: 20px;
    }
}

/*
 Better Spacing for Details Page */
.product-details .row {
    gap: 3rem;
}

.product-info {
    padding-right: 2rem;
}

.product-info>* {
    margin-bottom: 1.5rem;
}

.product-description {
    margin-top: 2rem;
}

/* Responsive Spacing */
@media (max-width: 991px) {
    .product-info {
        padding-right: 0;
        margin-top: 2rem;
    }

    .product-details .row {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .product-info>* {
        margin-bottom: 1rem;
    }

    .product-description {
        margin-top: 1.5rem;
    }
}

/* 
Rating Input Styles */
.rating-input {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.rating-input i {
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-input i:hover {
    transform: scale(1.2);
}

/* Review Form Styles */
#reviewForm {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

#reviewForm .form-label {
    color: var(--dark-brown);
    margin-bottom: 8px;
}

#reviewForm .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#reviewForm .form-control:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 0.2rem rgba(218, 165, 32, 0.25);
}

#reviewForm textarea {
    resize: vertical;
    min-height: 100px;
}

/* Review Card Animation */
.card.border-0.shadow-sm {
    transition: all 0.3s ease;
}

.card.border-0.shadow-sm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Product Details Info Cards */
.card-body .d-flex.align-items-center i {
    font-size: 1.5rem;
    width: 30px;
}

/* Main Product Image */
#main-product-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 15px;
}

/* Main Image Container */
.card-body.p-0 {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
}

/* Hover Effect */
.card.border-0.shadow-sm.mb-3:hover #main-product-image {
    transform: scale(1.03);
}

/* Thumbnail Container Styling */
.row.g-2 .col-3 {
    padding: 5px;
}

.row.g-2 .card {
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #fffbf5 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.08);
}

.row.g-2 .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.35);
}

/* Uniform Thumbnail Sizes */
.thumbnail-img.active {
    border-color: #DAA520;
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.2);
    transform: scale(1.05);
}

/* Smooth Transitions */
.thumbnail-img,
#main-product-image {
    transition: all 0.3s ease;
}

/* Smooth Parallax Transitions */
#main-product-image {
    transition: transform 0.2s ease-out;
}

.card-body.p-0:hover #main-product-image {
    transform: scale(1.05);
}

/* Related Products Images */
.related-products .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 10px;
    background: #fff;
}

.related-products .card:hover .card-img-top {
    transform: scale(1.03);
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    #main-product-image,
    .product-details .main-image img {
        height: 350px;
    }

    .thumbnail-img {
        height: 80px;
    }

    .related-products .card-img-top {
        height: 200px;
    }
}

@media (max-width: 576px) {

    #main-product-image,
    .product-details .main-image img {
        height: 300px;
    }

    .thumbnail-img {
        height: 70px;
    }

    .related-products .card-img-top {
        height: 180px;
    }
}

/* Related Products Cards - Same as Products Page */
.related-products .product-card {
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.08);
}

.related-products .product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.related-products .product-img {
    height: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
    width: 100% !important;
    object-position: center !important;
    display: block;
    padding: 10px !important;
    margin: 0;
}

.related-products .position-relative.overflow-hidden {
    height: 200px !important;
    min-height: 200px;
    max-height: 200px;
    overflow: hidden;
    background: #fff;
}

.related-products .product-card:hover .product-img {
    transform: scale(1.03);
}

.related-products .card-title {
    color: var(--black);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-products .card-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.related-products .price {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.2rem;
}

.related-products .btn-dark.rounded-circle {
    background: var(--black);
    border: none;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.related-products .btn-dark.rounded-circle:hover {
    background: var(--gold);
    transform: scale(1.1);
}

.related-products .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.related-products .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.related-products .btn-primary {
    background: #B8860B;
    border: none;
    transition: all 0.3s ease;
}

.related-products .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0px 0px 4px rgba(212, 175, 55, 0.2);
}

/* Responsive for Related Products */
@media (max-width: 768px) {
    .related-products .product-img {
        height: 180px !important;
        padding: 8px !important;
    }

    .related-products .position-relative.overflow-hidden {
        height: 180px !important;
        min-height: 180px;
        max-height: 180px;
    }
    
    .related-products .card-title {
        font-size: 1rem;
    }
    
    .related-products .price {
        font-size: 1.1rem;
    }
    
    #main-product-image,
    .product-details .main-image img {
        height: 350px;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .related-products .product-img {
        height: 160px !important;
        padding: 8px !important;
    }

    .related-products .position-relative.overflow-hidden {
        height: 160px !important;
        min-height: 160px;
        max-height: 160px;
    }
    
    .related-products .card-body {
        padding: 0.75rem;
    }
    
    #main-product-image,
    .product-details .main-image img {
        height: 300px;
        padding: 10px;
    }
}