/**
 * Elementor Widgets Styles
 * Romagna Server Configurator
 */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&display=swap');

/* ===========================================
   COMMON STYLES
   =========================================== */

/* Apply Urbanist font to all Elementor widgets */
.rsc-servers-grid,
.rsc-servers-grid *,
.rsc-server-info-widget,
.rsc-server-info-widget *,
.rsc-server-specs-widget,
.rsc-server-specs-widget *,
.rsc-server-gallery-widget,
.rsc-server-gallery-widget *,
.rsc-configurator-widget,
.rsc-configurator-widget * {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
}

.rsc-widget-notice {
    padding: 20px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    color: #92400e;
    text-align: center;
    font-size: 14px;
}

/* ===========================================
   SERVER GRID WIDGET
   =========================================== */

.rsc-servers-grid {
    display: grid;
    gap: 24px;
}

.rsc-grid-cols-1 { grid-template-columns: 1fr; }
.rsc-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rsc-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rsc-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .rsc-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .rsc-grid-cols-3,
    .rsc-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .rsc-grid-cols-2,
    .rsc-grid-cols-3,
    .rsc-grid-cols-4 { grid-template-columns: 1fr; }
}

.rsc-server-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.rsc-server-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.rsc-card-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rsc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.rsc-card-content {
    padding: 20px;
}

.rsc-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.rsc-card-price {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.rsc-card-price strong {
    font-size: 1.25rem;
    color: #2688DA;
    font-weight: 700;
}

.rsc-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.rsc-spec-item {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    color: #475569;
}

.rsc-card-shipping {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.rsc-card-shipping svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.rsc-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    background: #2688DA;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.rsc-card-button:hover {
    background: #1e6ab8;
    color: #ffffff;
    text-decoration: none;
}

.rsc-no-servers {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* ===========================================
   SERVER GALLERY WIDGET
   =========================================== */

.rsc-widget-gallery {
    width: 100%;
}

.rsc-gallery-main-image {
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rsc-gallery-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rsc-gallery-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    padding-bottom: 8px;
}

.rsc-gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.rsc-gallery-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.rsc-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.rsc-gallery-thumbs::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.rsc-gallery-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.rsc-gallery-thumb:hover,
.rsc-gallery-thumb.active {
    border-color: #2688DA;
}

.rsc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================================
   SERVER INFO WIDGET
   =========================================== */

.rsc-widget-info {
    width: 100%;
}

.rsc-info-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.rsc-info-price {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    background: #f0f7fc;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rsc-info-price-label {
    font-size: 0.9rem;
    color: #6b7280;
}

.rsc-info-price-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2688DA;
}

.rsc-info-price-vat {
    font-size: 0.8rem;
    color: #9ca3af;
}

.rsc-info-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rsc-info-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #374151;
}

.rsc-info-feature svg {
    flex-shrink: 0;
    color: #10b981;
}

/* ===========================================
   SERVER COMPONENTS WIDGET
   =========================================== */

.rsc-widget-components {
    width: 100%;
}

.rsc-components-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.rsc-components-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rsc-layout-grid .rsc-components-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .rsc-layout-grid .rsc-components-list {
        grid-template-columns: 1fr;
    }
}

.rsc-component-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
}

.rsc-component-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.rsc-component-type {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.rsc-component-count {
    font-size: 0.75rem;
    background: #e3f0fa;
    color: #2688DA;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.rsc-component-names {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

.rsc-component-more {
    display: inline-block;
    background: #e5e7eb;
    color: #6b7280;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 4px;
}

/* ===========================================
   SERVER CONFIGURATOR WIDGET
   =========================================== */

.rsc-configurator-widget {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

.rsc-configurator-widget.rsc-sticky-configurator {
    position: sticky;
    top: var(--sticky-offset, 100px);
}

.rsc-configurator-header {
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.rsc-configurator-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Loading state */
.rsc-configurator-widget .rsc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.rsc-configurator-widget .rsc-loading svg {
    color: #2688DA;
    margin-bottom: 16px;
}

.rsc-configurator-widget .rsc-loading p {
    margin: 0;
    font-size: 0.9rem;
}

/* ===========================================
   ELEMENTOR EDITOR STYLES
   =========================================== */

.elementor-editor-active .rsc-widget-notice {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .rsc-info-title {
        font-size: 1.5rem;
    }

    .rsc-info-price-value {
        font-size: 1.5rem;
    }

    .rsc-gallery-main-image {
        height: 300px;
    }

    .rsc-gallery-thumb {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .rsc-info-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ===========================================
   TECHNICAL DETAILS WIDGET
   =========================================== */

.rsc-widget-specs {
    width: 100%;
}

.rsc-specs-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.rsc-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.rsc-specs-row {
    border-bottom: 1px solid #f1f5f9;
}

.rsc-specs-row:last-child {
    border-bottom: none;
}

.rsc-specs-label {
    width: 120px;
    padding: 8px 16px 8px 0;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
    vertical-align: top;
    text-align: right;
    white-space: nowrap;
}

.rsc-specs-value {
    padding: 8px 16px 8px 16px;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rsc-specs-value .rsc-specs-option {
    display: block;
    margin-bottom: 2px;
}

.rsc-specs-value .rsc-specs-option:last-child {
    margin-bottom: 0;
}

.rsc-specs-category {
    font-style: italic;
    color: #6b7280;
    font-size: 0.85rem;
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Compact variant */
.rsc-specs-compact .rsc-specs-label {
    padding: 6px 12px 6px 0;
    font-size: 0.8rem;
}

.rsc-specs-compact .rsc-specs-value {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* With background */
.rsc-specs-with-bg {
    background: #f8fdf8;
    padding: 20px;
    border-radius: 8px;
}

.rsc-specs-with-bg .rsc-specs-title {
    border-bottom-color: #d1e7dd;
}

/* ===========================================
   CONFIGURATOR COMPACT OVERRIDES
   =========================================== */

.rsc-configurator-widget .rsc-step-item {
    padding: 6px 8px;
    margin-bottom: 4px;
}

.rsc-configurator-widget .rsc-step-title {
    font-size: 0.75rem;
}

.rsc-configurator-widget .rsc-option-item {
    padding: 5px 8px;
    margin-bottom: 4px;
}

.rsc-configurator-widget .rsc-option-name {
    font-size: 0.8rem;
}

.rsc-configurator-widget .rsc-option-price {
    font-size: 0.75rem;
}

/* Extra compact for widget context */
.rsc-configurator-widget .rsc-compact-components {
    gap: 0.5rem;
}

.rsc-configurator-widget .rsc-compact-field {
    gap: 0.1875rem;
}

.rsc-configurator-widget .rsc-field-label {
    font-size: 0.6875rem;
}

.rsc-configurator-widget .rsc-field-box {
    padding: 0.4375rem 0.625rem;
}

.rsc-configurator-widget .rsc-field-value {
    font-size: 0.75rem;
}

.rsc-configurator-widget .rsc-gpu-row {
    gap: 0.5rem;
}
