/**
 * Product Modals & Action Buttons - Premium Edition
 * SilvForLife Theme
 * @version 1.0.0
 */

/* === ACTION BUTTONS GROUP === */
.product-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn:hover svg {
    transform: scale(1.1);
}

/* Size guide specific */
.action-btn.size-guide-btn {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.action-btn.size-guide-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
}

/* === MODAL ANIMATIONS === */
.pf-size-guide-modal-wrapper,
#canvas-size-guide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    backdrop-filter: blur(0px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.pf-size-guide-modal-wrapper.modal-opening,
#canvas-size-guide-modal.modal-opening {
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pf-size-guide-modal-wrapper.modal-open,
#canvas-size-guide-modal.modal-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    opacity: 1;
}

.pf-size-guide-modal-wrapper.modal-closing,
#canvas-size-guide-modal.modal-closing {
    animation: modalFadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(8px);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(8px);
    }
    to {
        opacity: 0;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
}

.pf-size-guide-modal,
#canvas-size-guide-modal .pf-size-guide-modal {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-open .pf-size-guide-modal,
.modal-open #canvas-size-guide-modal .pf-size-guide-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-closing .pf-size-guide-modal,
.modal-closing #canvas-size-guide-modal .pf-size-guide-modal {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}

/* Modal content styles */
.pf-size-guide-modal {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 35, 0.98) 100%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(59, 130, 246, 0.1) inset;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.pf-size-guide-modal__header {
    padding: 28px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.pf-size-guide-modal__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.pf-size-guide-modal__close {
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pf-size-guide-modal__close:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: rotate(90deg) scale(1.05);
}

.pf-size-guide-modal__close img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.pf-size-guide-modal__content {
    padding: 32px;
}

/* Tabs styling */
.pf-size-guide-modal-size-chart__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 6px;
}

.pf-size-guide-modal-size-chart__tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

.pf-size-guide-modal-size-chart__tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.pf-size-guide-modal-size-chart__tab--active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: #60a5fa;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Table styling */
.pf-size-guide-modal-size-chart__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
}

.pf-size-guide-modal-size-chart__table thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
}

.pf-size-guide-modal-size-chart__table thead td {
    padding: 16px;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.pf-size-guide-modal-size-chart__table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.pf-size-guide-modal-size-chart__table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.pf-size-guide-modal-size-chart__table tbody td {
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

/* Measurements section */
.pf-size-guide-modal-measurements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(59, 130, 246, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.pf-size-guide-modal-measurements__description p {
    margin: 0 0 12px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.pf-size-guide-modal-measurements__description strong {
    color: #60a5fa;
}

/* Responsive */
@media (max-width: 768px) {
    .pf-size-guide-modal {
        max-width: 95vw;
        margin: 20px;
    }
    
    .pf-size-guide-modal-measurements {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}
