/* Foil Gallery Styles */
/* Digital Sleeking Foil color gallery with click-to-expand modal */

/* Gallery Section Header */
.foil-gallery-section {
    margin-bottom: 20px;
}

.foil-gallery__title {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.foil-gallery__intro {
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

/* Gallery Grid */
.foil-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.foil-sample {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.foil-sample:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.foil-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Foil color previews */
.foil-preview.gold {
    background: linear-gradient(135deg, #f6e27a, #d4af37);
}

.foil-preview.silver {
    background: linear-gradient(135deg, #e6e6e6, #c0c0c0);
}

.foil-preview.matte-gold {
    background-color: #d4af37;
}

.foil-preview.matte-silver {
    background-color: #c0c0c0;
}

.foil-preview.copper {
    background: linear-gradient(135deg, #da8a67, #b87333);
}

.foil-preview.rose-gold {
    background: linear-gradient(135deg, #f8c3b5, #e7a99a);
}

.foil-preview.rainbow {
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #00ff00);
    background-size: 400% 400%;
    animation: gradient 5s ease infinite;
}

.foil-preview.red {
    background: linear-gradient(135deg, #ff5555, #cc0000);
}

.foil-preview.green {
    background: linear-gradient(135deg, #55ff55, #00cc00);
}

.foil-preview.blue {
    background: linear-gradient(135deg, #5555ff, #0000cc);
}

.foil-preview.black {
    background-color: #222;
}

.foil-preview.clear {
    background-color: #f5f5f5;
    position: relative;
}

.foil-preview.clear::before {
    content: "✨";
    font-size: 24px;
    color: #666;
}

.foil-caption {
    padding: 10px;
    text-align: center;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 14px;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Printable badge indicator */
.foil-printable-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: var(--secondary, #f68b1f);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Compact gallery variant (for sidebars) */
.foil-gallery--compact {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.foil-gallery--compact .foil-preview {
    height: 80px;
}

.foil-gallery--compact .foil-caption {
    padding: 6px;
    font-size: 11px;
}

.foil-gallery--compact .foil-printable-badge {
    width: 14px;
    height: 14px;
    font-size: 8px;
}

/* Animation for rainbow effect */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Foil Detail Modal - Override .modal-overlay display:none */
.foil-modal.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.foil-modal.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.foil-modal .modal-content {
    width: 80%;
    max-width: 800px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    position: relative;
}

/* Close button for detail modal */
.foil-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    height: 32px;
    width: 32px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background-color 0.2s ease;
}

.foil-modal-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

.foil-modal-title {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
}

.foil-modal-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.foil-modal-description {
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.foil-modal-meta {
    margin-bottom: 20px;
}

.foil-modal-printable {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--highlight, #fff1e6);
    border-radius: 4px;
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text, #363636);
}

.foil-modal-printable:empty {
    display: none;
}

.foil-examples {
    margin-top: 30px;
}

.foil-examples h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--secondary);
}

.foil-examples-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .foil-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .foil-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .foil-examples-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .foil-gallery {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Foil Gallery Trigger Card
   ======================================== */

/* Card variant - for floating within content */
.foil-gallery-card {
    max-width: 200px;
}

.foil-gallery-card__trigger {
    display: block;
    width: 100%;
    padding: 0;
    background: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-decoration: none;
}

.foil-gallery-card__trigger:hover {
    background: #e8eaed;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.foil-gallery-card__thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.foil-gallery-card__swatches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    height: 100%;
}

.foil-gallery-card__swatch {
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.foil-gallery-card__trigger:hover .foil-gallery-card__swatch {
    transform: scale(1.05);
}

.foil-gallery-card__swatch--gold {
    background: linear-gradient(135deg, #f6e27a, #d4af37);
}

.foil-gallery-card__swatch--silver {
    background: linear-gradient(135deg, #e6e6e6, #c0c0c0);
}

.foil-gallery-card__swatch--copper {
    background: linear-gradient(135deg, #da8a67, #b87333);
}

.foil-gallery-card__swatch--rose-gold {
    background: linear-gradient(135deg, #f8c3b5, #e7a99a);
}

.foil-gallery-card__swatch--blue {
    background: linear-gradient(135deg, #5555ff, #0000cc);
}

.foil-gallery-card__swatch--holo {
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #00ff00);
    background-size: 400% 400%;
    animation: foil-holo-shift 3s ease infinite;
}

@keyframes foil-holo-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.foil-gallery-card__info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.foil-gallery-card__label {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.foil-gallery-card__title {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #022662);
    margin: 0;
}

.foil-gallery-card__hint {
    font-size: 11px;
    color: #666;
}

/* Link variant - inline text link */
.foil-gallery-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--secondary, #f68b1f);
    border-radius: 4px;
    color: var(--secondary, #f68b1f);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foil-gallery-link:hover {
    background: var(--secondary, #f68b1f);
    color: white;
}

.foil-gallery-link__icon {
    display: flex;
    align-items: center;
}

/* Text-wrap floating styles (for use in content sections) */
.foil-gallery-card--float-left {
    float: left;
    margin: 0 20px 15px 0;
    clear: left;
}

.foil-gallery-card--float-right {
    float: right;
    margin: 0 0 15px 20px;
    clear: right;
}

@media (max-width: 600px) {
    .foil-gallery-card--float-left,
    .foil-gallery-card--float-right {
        float: none;
        margin: 20px auto;
        max-width: 100%;
    }
}

/* ========================================
   Foil Gallery Modal (shows all swatches)
   ======================================== */

/* Override .modal-overlay display:none from main.css */
.foil-gallery-modal.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.foil-gallery-modal.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.foil-gallery-modal__content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    position: relative;
}

/* Close button for gallery modal */
.foil-gallery-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    height: 32px;
    width: 32px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background-color 0.2s ease;
}

.foil-gallery-modal-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

.foil-gallery-modal__title {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary, #022662);
    margin: 0 0 12px 0;
}

.foil-gallery-modal__intro {
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text, #363636);
    margin: 0 0 24px 0;
}

.foil-gallery-modal__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.foil-gallery-modal__grid .foil-sample {
    margin: 0;
}

.foil-gallery-modal__grid .foil-preview {
    height: 100px;
}

.foil-gallery-modal__grid .foil-caption {
    padding: 8px;
    font-size: 12px;
}

/* Back button for detail modal */
.foil-modal-back {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--secondary, #f68b1f);
    border-radius: 4px;
    color: var(--secondary, #f68b1f);
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foil-modal-back:hover {
    background: var(--secondary, #f68b1f);
    color: white;
}

/* Detail modal - position content below back button */
.foil-modal .modal-content {
    position: relative;
    padding-top: 50px;
}

/* Gallery modal responsive */
@media (max-width: 768px) {
    .foil-gallery-modal__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .foil-gallery-modal__content {
        padding: 20px;
    }

    .foil-gallery-modal__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .foil-gallery-modal__grid .foil-preview {
        height: 80px;
    }
}