/* WP Garantija Frontend Styles */

.wp-garantija-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wp-garantija-certificate {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wp-garantija-certificate h3 {
    margin-top: 0;
    color: #333;
}

.wp-garantija-certificate-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.wp-garantija-meta-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.wp-garantija-meta-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.wp-garantija-meta-value {
    color: #333;
}

/* Warranty Options Styles */
.wp-garantija-warranty-options {
    margin: 25px 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    position: relative;
}

.garantija-toggle-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0;
}

.garantija-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.garantija-header:hover {
    background: rgba(99, 102, 241, 0.05);
}

.garantija-shield-icon {
    margin-right: 12px;
    flex-shrink: 0;
}

.garantija-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.garantija-title {
    display: flex;
    align-items: center;
}

.garantija-main-text {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.garantija-selected-info {
    margin-top: 2px;
}

.selected-plan-text {
    font-size: 13px;
    color: #6366f1;
    font-weight: 500;
}

.garantija-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #6366f1;
    cursor: pointer;
    transition: color 0.2s ease;
    min-height: 32px;
    padding: 0;
}

.garantija-toggle-btn:hover:not(.disabled) {
    color: #5856eb;
}

.garantija-toggle-btn.disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.garantija-toggle-btn.disabled .toggle-text {
    font-size: 12px;
}

.toggle-arrow {
    transition: transform 0.2s ease;
    width: 14px;
    height: 14px;
}

.garantija-toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}

.garantija-plans-container {
    border-top: 1px solid #e5e7eb;
    background: white;
    overflow: visible;
    transition: height 0s ease-in-out;
}

.garantija-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    color: #6b7280;
    min-height: 80px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.garantija-plans-content {
    padding: 15px;
    min-height: 200px;
}

.garantija-plans-grid {
    display: grid;
    gap: 15px;
}

.garantija-plan-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: visible;
    transition: all 0.2s ease;
    position: relative;
    background: #fff;
}

.garantija-plan-section.expanded {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.plan-header {
    display: flex;
    align-items: center;
    padding: 5px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: #f8fafc;
    border-radius: 7px 7px 0 0;
    position: relative;
}

.plan-header:hover {
    background: #f1f5f9;
}

/* Ensure proper border radius when plan is not expanded */
.garantija-plan-section:not(.expanded) .plan-header {
    border-radius: 7px;
}

.plan-info {
    flex: 1;
    padding-top: 5px;
}

.plan-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-price-from {
font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    background: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
}

.plan-info-icon {
    position: relative;
    cursor: help;
    color: #6b7280;
    transition: color 0.2s ease;
}

.plan-info-icon:hover {
    color: #4b5563;
}

.plan-info-icon:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 50%;
    color: #4b5563;
}

.plan-info-icon {
    position: relative;
}

.plan-info-icon .tooltip-content {
    position: fixed;
    background: linear-gradient(177deg, #5154de 0%, #5a5cd8 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
    max-width: 320px;
    min-width: 320px;
    line-height: 1.5;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    text-align: left;
    word-wrap: break-word;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.plan-info-icon:hover .tooltip-content,
.plan-info-icon:focus .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.plan-info-icon .tooltip-content ul {
    margin: 8px 0 0 0;
    padding-left: 0;
    list-style: none;
}

.plan-info-icon .tooltip-content ul li {
    margin: 6px 0;
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}

.plan-info-icon .tooltip-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #93c5fd;
    font-weight: bold;
    font-size: 16px;
}

.plan-info-icon .tooltip-content h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #e0e7ff;
}

.plan-toggle-btn {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.plan-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.plan-toggle-arrow {
    transition: transform 0.2s ease;
    color: #6b7280;
}

.garantija-plan-section.expanded .plan-toggle-arrow {
    transform: rotate(180deg);
}

.woocommerce-cart-form__cart-item .variation-Iplstagarantija{
    display: none;
}

.plan-periods {
    padding: 16px 20px;
    display: grid;
    gap: 12px;
    background: #fff;
    border-radius: 0 0 7px 7px;
    position: relative;
}

.warranty-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.warranty-option:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.warranty-option input[type="radio"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.warranty-option input[type="radio"]:checked + .warranty-details {
    font-weight: 600;
}

.warranty-option:has(input[type="radio"]:checked) {
    border-color: #6366f1;
    background: #eff6ff;
}

.warranty-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.warranty-period {
    color: #374151;
    font-size: 14px;
}

.warranty-price {
color: #6366f1;
    font-weight: 600;
    font-size: 15px;
}

.garantija-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.garantija-add-warranty {
    background: #10b981 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.garantija-add-warranty:hover:not(:disabled) {
    background: #059669 !important;
}

.garantija-add-warranty:disabled {
    background: #d1d5db !important;
    cursor: not-allowed !important;
}

/* Error states */
.garantija-error {
    padding: 20px 24px;
    background: #fef2f2;
    color: #991b1b;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .garantija-header {
        padding: 12px 16px;
    }
    
    .garantija-main-text {
        font-size: 14px;
    }
    
    .selected-plan-text {
        font-size: 12px;
    }
    
    .garantija-toggle-btn {
        font-size: 12px;
        min-height: 28px;
    }
    
    .toggle-arrow {
        width: 12px;
        height: 12px;
    }
    
    .garantija-plans-content {
        padding: 20px 16px;
    }
    
    .warranty-option {
        padding: 10px 12px;
    }
     
    .plan-info-icon .tooltip-content {
        max-width: 90vw;
        min-width: 90vw;
    }
    
    .plan-info-icon:hover .tooltip-content,
    .plan-info-icon:focus .tooltip-content,
    .plan-info-icon:active .tooltip-content {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
    
    .garantija-shield-icon {
        display: none;
    }
}

@media (max-width: 480px) {
    .garantija-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .garantija-toggle-btn {
        flex-shrink: 0;
    }
}
