/* ============================================
   COLLECTION SECTIONS - MODERN GAMING DESIGN
   ============================================ */

/* Container - Ultra compact padding */
.custom-sneakpeak {
    width: 100%;
    padding: clamp(1rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 1.5rem);
    margin: 0 auto;
    max-width: 1560px;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.custom-sneakpeak > .row > .col-md-6 {
    margin-bottom: 1rem !important; /* Remove bottom margin, handled by Bootstrap g-3 gutter */
}

/* Responsive containers */
@media (max-width: 1200px) {
    .custom-sneakpeak {
        max-width: 1140px !important;
    }
}
@media (max-width: 992px) {
    .custom-sneakpeak {
        max-width: 960px !important;
    }
}
@media (max-width: 768px) {
    .custom-sneakpeak {
        max-width: 720px !important;
    }
}
@media (max-width: 576px) {
    .custom-sneakpeak {
        max-width: 540px !important;
        padding: 2rem 1rem;
    }
}

/* Preview Box - Card Container */
.custom-preview-box {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%; /* Fill column height for consistent sizing */
    padding: 6px;
    /* No margin-bottom - Bootstrap g-3 gutter handles vertical spacing */
}

.custom-preview-box:hover {
    /* transform: translateY(-4px); */
    box-shadow: 0 12px 40px rgba(43, 141, 80, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Header Section - Gaming-inspired gradient - Compact padding */
.custom-preview-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 2.5vw, 2rem);
    background: linear-gradient(135deg, #2b8d50 0%, #1e6e3a 50%, #164d29 100%);
    background-size: 200% 200%;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: -6px;
}

.custom-preview-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.custom-preview-header:hover::before {
    left: 100%;
}

.custom-preview-header:hover {
    background-position: 100% 100%;
}

/* Title Section */
.custom-preview-title-section {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.custom-preview-title {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-tight, -0.02em);
    line-height: var(--leading-tight, 1.25);
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.custom-preview-header:hover .custom-preview-title {
    transform: translateX(4px);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Icon */
.custom-icon {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1rem, 2vw, 1.5rem) !important;
    transition: all 0.3s ease;
}

.custom-preview-header:hover .custom-icon {
    color: #ffffff;
    transform: translateX(4px);
}

/* Link Section */
.custom-preview-link {
    font-family: var(--font-primary, "Inter", sans-serif);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--weight-semibold, 600);
    letter-spacing: var(--tracking-wide, 0.025em);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.custom-preview-header:hover .custom-preview-link {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Subtitle - Ultra compact padding */
.custom-preview-subtitle {
    display: block;
    font-family: var(--font-primary, "Inter", sans-serif);
    font-size: var(--text-base, 1rem);
    font-weight: var(--weight-semibold, 600);
    letter-spacing: var(--tracking-normal, 0);
    color: #1a1a1a;
    padding: clamp(0.75rem, 1.5vw, 1.25rem) clamp(1.25rem, 2.5vw, 2rem);
    padding-bottom: clamp(0.5rem, 1vw, 0.75rem);
    margin: 0;
    border-bottom: 2px solid #f0f0f0;
}

/* Product Grid - Minimal top/bottom padding only */
.custom-preview-items-grid {
    padding-top: clamp(0.75rem, 1.5vw, 1.25rem);
    padding-bottom: clamp(0.75rem, 1.5vw, 1.25rem);
    /* Let Bootstrap handle horizontal padding via gutters */
}

/* Product Item Cards - Bootstrap g-2 gutter handles all spacing */

.custom-sneakpeak-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-preview-product-card {
    display: flex;
    flex-direction: column; /* Stack image above text */
    gap: 0; /* No gap - image and text are separate sections */
    background: #ffffff;
    /* border: 2px solid #f0f0f0; */
    border-radius: 12px;
    transition: all 0.25s ease;
    overflow: hidden; /* Clean edges for image */
    height: 100%;
}

.custom-sneakpeak-link:hover .custom-preview-product-card {
    border-color: #2b8d50;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff9 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(43, 141, 80, 0.1),
        0 8px 20px rgba(43, 141, 80, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.row.custom-preview-items-grid > .col-md-6.custom-preview-item {
    margin-bottom: 1rem;
}

/* Product Image - Full width, stacked above text */
.custom-product-image-wrapper {
    width: 100%; /* Full width of card */
    height: 0;
    padding-bottom: 140%; /* 140% = card aspect ratio (taller than wide for MTG cards) */
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    transition: all 0.25s ease;
}

.custom-product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

.custom-sneakpeak-link:hover .custom-product-image-wrapper img {
    opacity: 0.95;
}

/* Product Details - Below image with padding */
.custom-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: clamp(1rem, 2vw, 1.25rem);
    min-width: 0; /* Fix for text overflow */
}

.custom-product-name {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-size: var(--text-base, 3rem);
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-tight, -0.01em);
    line-height: var(--leading-snug, 1.375);
    color: #1a1a1a;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
    padding-bottom: 0;
}

.custom-sneakpeak-link:hover .custom-product-name {
    color: #2b8d50;
}

.custom-product-set {
    font-family: var(--font-primary, "Inter", sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--weight-medium, 500);
    color: #666666;
    letter-spacing: var(--tracking-normal, 0);
    line-height: var(--leading-normal, 1.5);
    margin: 0;
    transition: color 0.3s ease;
}

.custom-sneakpeak-link:hover .custom-product-set {
    color: #4a4a4a;
}

.custom-product-price {
    font-family: var(--font-primary, "Inter", sans-serif);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--weight-bold, 700);
    color: #2b8d50;
    letter-spacing: var(--tracking-normal, 0);
    margin: 0;
    padding-top: clamp(0.25rem, 0.5vw, 0.375rem);
    transition: all 0.3s ease;
    padding: 0;
}

.custom-sneakpeak-link:hover .custom-product-price {
    color: #1e6e3a;
}

.custom-product-price-label {
    font-weight: var(--weight-medium, 500);
    font-size: var(--text-xs, 0.75rem);
    color: #999999;
    margin-right: 0.25rem;
    letter-spacing: var(--tracking-wide, 0.025em);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .custom-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .custom-preview-link {
        align-self: flex-end;
    }

    .custom-preview-title-section {
        width: 100%;
    }

    .custom-product-details {
        padding: 0.875rem;
        gap: 0.375rem;
    }
}

@media (max-width: 576px) {
    .custom-preview-box {
        border-radius: 12px;
    }

    .custom-preview-header {
        border-radius: 12px 12px 0 0;
    }

    .custom-product-details {
        padding: 0.75rem;
    }
}

/* Loading States */
.custom-preview-box.loading {
    opacity: 0.6;
    pointer-events: none;
}

.custom-preview-box.loading .custom-preview-header {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Accessibility */
.custom-preview-header:focus-visible,
.custom-sneakpeak-link:focus-visible {
    outline: 3px solid #2b8d50;
    outline-offset: 2px;
}

/* Tooltip Styling */
.custom-card-tooltip {
    --bs-tooltip-bg: #1a1a1a;
    --bs-tooltip-color: #ffffff;
    --bs-tooltip-padding-x: 0.75rem;
    --bs-tooltip-padding-y: 0.5rem;
    --bs-tooltip-font-size: 0.875rem;
    --bs-tooltip-border-radius: 0.5rem;
}

.custom-card-tooltip .tooltip-inner {
    max-width: 300px;
    text-align: left;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Print Styles */
@media print {
    .custom-preview-box {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        page-break-inside: avoid;
    }

    .custom-preview-header {
        background: #2b8d50 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
