/* ========================================
   MODERN RELATED PRODUCTS SECTION
   ======================================== */

:root {
    --gold-primary: #D4AF37;
    --gold-dark: #B8941E;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ========================================
   Section Container
   ======================================== */
.related-products-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg-light) 100%);
    position: relative;
    overflow: hidden;
}

.related-products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--gold-primary) 50%, 
        transparent 100%);
    opacity: 0.3;
}

.related-products-section .container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========================================
   Section Header
   ======================================== */
.related-section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.related-section-header .header-content {
    position: relative;
    display: inline-block;
}

.related-section-header .section-subtitle {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-primary);
    margin-bottom: 12px;
    animation: fadeInDown 0.6s ease-out;
}

.related-section-header .section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 15px 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.related-section-header .title-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.related-section-header .title-underline {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    border-radius: 2px;
    animation: expandWidth 0.8s ease-out 0.4s backwards;
}

@keyframes expandWidth {
    0% {
        width: 0;
    }
    100% {
        width: 100px;
    }
}

.related-section-header .section-description {
    font-size: 16px;
    color: var(--text-gray);
    margin: 20px 0 0 0;
    font-style: italic;
    animation: fadeIn 0.6s ease-out 0.6s backwards;
}

/* ========================================
   Product Grid
   ======================================== */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin: 0;
    padding: 0;
}

/* ========================================
   Product Card
   ======================================== */
.related-product-card {
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
}

.related-product-card:nth-child(1) { animation-delay: 0.1s; }
.related-product-card:nth-child(2) { animation-delay: 0.2s; }
.related-product-card:nth-child(3) { animation-delay: 0.3s; }
.related-product-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-product-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-product-box:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold-primary);
}

/* ========================================
   Product Image
   ======================================== */
.related-product-image {
    position: relative;
    width: 100%;
    padding-top: 125%; /* 4:5 aspect ratio */
    overflow: hidden;
    background: var(--bg-light);
}

.related-product-image .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-product-box:hover .product-img {
    transform: scale(1.15);
}

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(212, 175, 55, 0.95) 0%,
        rgba(184, 148, 30, 0.95) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.related-product-box:hover .image-overlay {
    opacity: 1;
}

.image-overlay .view-details {
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 30px;
    border: 2px solid var(--white);
    border-radius: 50px;
    background: transparent;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.related-product-box:hover .image-overlay .view-details {
    transform: translateY(0);
}

/* Product Badge - Uses existing badge styles */
.related-product-image .product-labels {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

/* ========================================
   Product Info
   ======================================== */
.related-product-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product Type Badge */
.product-type {
    display: flex;
    align-items: center;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--white);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* Product Title */
.product-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
    transition: color 0.3s ease;
}

.related-product-box:hover .product-title {
    color: var(--gold-primary);
}

/* Product Meta */
.product-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-gray);
}

.meta-icon {
    width: 16px;
    height: 16px;
    color: var(--gold-primary);
    flex-shrink: 0;
}

.meta-label {
    font-weight: 600;
    color: var(--text-dark);
}

.meta-value {
    font-weight: 500;
    color: var(--text-gray);
}

/* ========================================
   Price Section
   ======================================== */
.product-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: auto;
}

.price-wrapper {
    flex-grow: 1;
}

.price-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.price-amount {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--gold-primary);
    line-height: 1;
}

/* Quick View Button */
.quick-view-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.quick-view-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.quick-view-btn:hover {
    border-color: var(--gold-primary);
    background: var(--gold-primary);
    transform: scale(1.1);
}

.quick-view-btn:hover svg {
    color: var(--white);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Desktop Large (1200px - 1399px) */
@media (max-width: 1399px) {
    .related-products-grid {
        gap: 25px;
    }
    
    .related-section-header .section-title {
        font-size: 2.25rem;
    }
}

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    .related-products-section {
        padding: 60px 0;
    }
    
    .related-section-header {
        margin-bottom: 50px;
    }
    
    .related-section-header .section-title {
        font-size: 2rem;
    }
    
    .related-products-grid {
        gap: 20px;
    }
    
    .related-product-info {
        padding: 20px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .related-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .related-section-header .section-title {
        font-size: 1.75rem;
    }
    
    .product-title {
        font-size: 15px;
    }
    
    .price-amount {
        font-size: 20px;
    }
}

/* Tablet Small (576px - 767px) */
@media (max-width: 767px) {
    .related-products-section {
        padding: 50px 0;
    }
    
    .related-section-header {
        margin-bottom: 40px;
    }
    
    .related-section-header .section-subtitle {
        font-size: 12px;
        letter-spacing: 1.5px;
    }
    
    .related-section-header .section-title {
        font-size: 1.5rem;
        gap: 10px;
    }
    
    .related-section-header .title-icon {
        font-size: 1.5rem;
    }
    
    .related-section-header .section-description {
        font-size: 14px;
    }
    
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .related-product-info {
        padding: 18px;
        gap: 12px;
    }
    
    .product-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .product-meta {
        padding: 12px 0;
        gap: 8px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .meta-icon {
        width: 14px;
        height: 14px;
    }
    
    .price-amount {
        font-size: 18px;
    }
    
    .quick-view-btn {
        width: 40px;
        height: 40px;
    }
    
    .quick-view-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile (< 576px) */
@media (max-width: 575px) {
    .related-products-section {
        padding: 40px 0;
    }
    
    .related-section-header {
        margin-bottom: 30px;
    }
    
    .related-section-header .section-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .related-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .related-product-box {
        display: grid;
        grid-template-columns: 140px 1fr;
        gap: 15px;
    }
    
    .related-product-image {
        padding-top: 0;
        height: 100%;
        min-height: 180px;
    }
    
    .related-product-info {
        padding: 15px 15px 15px 0;
    }
    
    .product-meta {
        gap: 6px;
    }
    
    .image-overlay {
        display: none;
    }
}

/* Extra Small Mobile (< 400px) */
@media (max-width: 399px) {
    .related-section-header .section-title {
        font-size: 1.125rem;
    }
    
    .related-product-box {
        grid-template-columns: 120px 1fr;
        gap: 12px;
    }
    
    .related-product-image {
        min-height: 160px;
    }
    
    .related-product-info {
        padding: 12px 12px 12px 0;
        gap: 10px;
    }
    
    .product-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .type-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .price-amount {
        font-size: 16px;
    }
    
    .quick-view-btn {
        width: 36px;
        height: 36px;
    }
    
    .quick-view-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .related-products-section {
        background: white;
        padding: 20px 0;
    }
    
    .related-product-box {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .image-overlay,
    .quick-view-btn {
        display: none;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.product-card-link:focus {
    outline: 3px solid var(--gold-primary);
    outline-offset: 4px;
    border-radius: var(--radius-lg);
}

.quick-view-btn:focus {
    outline: 3px solid var(--gold-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

