/**
 * ProductFiles Upload - Modal CSS
 * Styles for file viewer modal
 */

/* Files list */
.productfiles-list {
    margin: 20px 0;
}

.productfiles-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.productfile-item {
    margin-bottom: 10px;
}

/* =============================================
   STYLE: BUTTON (default) - Similar to Add to Cart
   ============================================= */
.productfiles-list.style-button .productfile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #212529;
    border-radius: 0;
    text-decoration: none;
    color: #212529;
    transition: all 0.3s ease;
    font-family: 'Abhaya Libre', serif;
    font-weight: 900;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
}

.productfiles-list.style-button .productfile-link:hover {
    background: #212529;
    color: #fff;
    text-decoration: none;
}

.productfiles-list.style-button .productfile-link:hover .file-icon svg {
    fill: #fff;
}

.productfiles-list.style-button .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.productfiles-list.style-button .file-icon svg {
    width: 20px;
    height: 20px;
    fill: #212529;
    transition: fill 0.3s ease;
}

.productfiles-list.style-button .file-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.productfiles-list.style-button .file-title {
    font-weight: 900;
    font-size: 15px;
    line-height: 1.2;
}

.productfiles-list.style-button .file-description {
    font-size: 12px;
    font-weight: 400;
    color: #6c757d;
    margin-top: 2px;
}

.productfiles-list.style-button .file-size {
    display: none;
}

/* With description visible */
.productfiles-list.style-button.show-description .file-description {
    display: block;
}

.productfiles-list.style-button:not(.show-description) .file-description {
    display: none;
}

/* With size visible */
.productfiles-list.style-button.show-size .file-size {
    display: inline;
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

/* =============================================
   STYLE: CARD - Original card style
   ============================================= */
.productfiles-list.style-card .productfile-link {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    transition: all 0.3s ease;
}

.productfiles-list.style-card .productfile-link:hover {
    background: #e9ecef;
    border-color: #25b9d7;
    transform: translateX(5px);
    text-decoration: none;
    color: #212529;
}

.productfiles-list.style-card .file-icon {
    font-size: 32px;
    margin-right: 15px;
    flex-shrink: 0;
}

.productfiles-list.style-card .file-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.productfiles-list.style-card .file-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.productfiles-list.style-card .file-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 4px;
}

.productfiles-list.style-card .file-size {
    font-size: 12px;
    color: #adb5bd;
}

/* =============================================
   Legacy support (no style class = button style)
   ============================================= */
.productfiles-list:not(.style-card):not(.style-button) .productfile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #212529;
    border-radius: 0;
    text-decoration: none;
    color: #212529;
    transition: all 0.3s ease;
    font-family: 'Abhaya Libre', serif;
    font-weight: 900;
    font-size: 15px;
}

.productfiles-list:not(.style-card):not(.style-button) .productfile-link:hover {
    background: #212529;
    color: #fff;
    text-decoration: none;
}

.productfiles-list:not(.style-card):not(.style-button) .file-icon {
    display: flex;
    align-items: center;
}

.productfiles-list:not(.style-card):not(.style-button) .file-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.productfiles-list:not(.style-card):not(.style-button) .file-title {
    font-weight: 900;
}

.productfiles-list:not(.style-card):not(.style-button) .file-description,
.productfiles-list:not(.style-card):not(.style-button) .file-size {
    display: none;
}

/* Modal */
.productfiles-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    display: none;
    margin: 0 !important;
    padding: 0 !important;
}

.productfiles-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 1;
}

.productfiles-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 1000px !important;
    max-height: 90vh !important;
    margin: 0 !important;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.productfiles-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.productfiles-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.productfiles-modal-header {
    padding: 20px 60px 20px 20px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.productfiles-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.productfiles-modal-body {
    flex-grow: 1;
    overflow: auto;
    padding: 20px;
    max-height: calc(90vh - 160px);
}

.productfiles-viewer {
    width: 100%;
    min-height: 300px;
}

.productfiles-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    text-align: right;
}

.productfiles-download-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #25b9d7;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.productfiles-download-btn:hover {
    background: #1e9bb8;
    color: #fff;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .productfiles-modal-content {
        width: 95vw !important;
        max-height: 95vh !important;
    }

    .productfile-link {
        padding: 10px;
    }

    .productfile-link .file-icon {
        font-size: 24px;
        margin-right: 10px;
    }

    .productfile-link .file-title {
        font-size: 14px;
    }

    .productfiles-modal-body {
        max-height: calc(95vh - 140px);
    }
}
