/**
 * Georgian Tire Widget 3D - v1.1.0
 * Updated: white inputs, colored season icons, M+S
 */

:root {
    --gtw-primary: #00bcd4;
    --gtw-primary-dark: #0097a7;
    --gtw-secondary: #4caf50;
    --gtw-bg-light: #e3f2fd;
    --gtw-text-dark: #1a1a1a;
    --gtw-text-light: #666;
    --gtw-border: #ddd;
    --gtw-shadow: rgba(0, 0, 0, 0.1);
    --gtw-radius: 12px;
    --gtw-winter-color: #00bcd4;
    --gtw-summer-color: #f9a825;
    --gtw-allseason-color: #00bcd4;
}

/* ========================================
   Main Container
======================================== */
.gtw-tire-widget-container {
    background: linear-gradient(135deg, #e3f2fd 0%, #cfe9f3 100%);
    border-radius: 16px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* ========================================
   Main Wrapper - Horizontal Layout
======================================== */
.gtw-widget-wrapper {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: 240px;
}

/* ========================================
   Left Section
======================================== */
.gtw-left-section {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gtw-header-badge {
    display: inline-block;
    background: rgba(0, 188, 212, 0.1);
    color: var(--gtw-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    align-self: flex-start;
}

.gtw-widget-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gtw-text-dark);
    margin: 0 0 8px 0;
    line-height: 1.2;
    font-family: 'BPG Nino Mtavruli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.gtw-widget-subtitle {
    font-size: 13px;
    color: var(--gtw-text-light);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ========================================
   Season Tabs — v1.1.0 ფერადი აიქონები (3 ტაბი)
======================================== */
.gtw-season-tabs {
    display: flex;
    gap: 10px;
}

.gtw-season-tab {
    flex: 1;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gtw-text-dark);
}

.gtw-season-tab:hover {
    border-color: var(--gtw-primary);
    background: rgba(0, 188, 212, 0.05);
}

.gtw-season-tab.active {
    background: white;
    color: var(--gtw-primary);
    border-color: var(--gtw-primary);
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.2);
}

.gtw-tab-icon {
    font-size: 16px;
}

/* ❄ ფიფქა — ცისფერი */
.gtw-icon-winter {
    color: var(--gtw-winter-color) !important;
    font-size: 18px;
}

/* ☀ მზე — ყვითელი */
.gtw-icon-summer {
    color: var(--gtw-summer-color) !important;
    font-size: 18px;
}

/* ✱ ყველა */
.gtw-icon-all {
    color: var(--gtw-primary) !important;
    font-size: 18px;
    font-weight: 700;
}

/* M+S — ყველა სეზონი ბეჯი */
.gtw-icon-allseason {
    font-size: 10px !important;
    font-weight: 800;
    color: var(--gtw-allseason-color) !important;
    background: rgba(0, 188, 212, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* აქტიურ ტაბში ფერები ტექსტთან ერთად */
.gtw-season-tab.active .gtw-icon-winter,
.gtw-season-tab.active .gtw-icon-summer,
.gtw-season-tab.active .gtw-icon-all {
    color: var(--gtw-primary) !important;
}

.gtw-season-tab.active .gtw-icon-allseason {
    color: var(--gtw-primary) !important;
    background: rgba(0, 188, 212, 0.15);
}

/* ========================================
   Right Section - Tire & Selectors
======================================== */
.gtw-right-section {
    position: relative;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ========================================
   Size Selectors - Top Row
======================================== */
.gtw-size-selectors-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.gtw-selector-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gtw-selector-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gtw-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ========================================
   Select ველები — თეთრი ფონი, შავი ტექსტი
======================================== */
.gtw-size-select {
    width: 100%;
    height: 44px;
    padding: 0 35px 0 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    color: #000000 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gtw-size-select option {
    background-color: #ffffff;
    color: #000000;
}

.gtw-size-select:hover:not(:disabled) {
    border-color: var(--gtw-primary);
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.2);
}

.gtw-size-select:focus {
    outline: none;
    border-color: var(--gtw-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.gtw-size-select:disabled {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   Search Button
======================================== */
.gtw-search-btn {
    background: var(--gtw-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 110px;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
    height: 44px;
    align-self: end;
}

.gtw-search-btn:hover:not(:disabled) {
    background: var(--gtw-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}

.gtw-search-btn:active:not(:disabled) {
    transform: translateY(0);
}

.gtw-search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.gtw-search-btn.loading .gtw-btn-text {
    opacity: 0;
}

.gtw-search-btn.loading .gtw-btn-loader {
    opacity: 1;
}

.gtw-btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: gtw-spin 0.8s linear infinite;
    opacity: 0;
}

@keyframes gtw-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   Tire Image Wrapper
======================================== */
.gtw-tire-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.gtw-tire-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

/* ========================================
   Tire Labels with Pointers
======================================== */
.gtw-tire-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0;
}

.gtw-label-pointer {
    width: 2px;
    height: 60px;
    background: var(--gtw-primary);
    position: relative;
}

.gtw-label-pointer::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gtw-primary);
    border-radius: 50%;
}

.gtw-label-value {
    background: var(--gtw-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
    transition: transform 0.3s ease;
}

/* Position Labels */
.gtw-label-width {
    top: 48%;
    left: -8%;
    transform: translateY(-50%);
}

.gtw-label-width .gtw-label-pointer {
    transform: rotate(0deg);
}

.gtw-label-width .gtw-label-pointer::after {
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
}

.gtw-label-profile {
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
}

.gtw-label-profile .gtw-label-pointer {
    width: 2px;
    height: 50px;
}

.gtw-label-profile .gtw-label-pointer::after {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.gtw-label-rim {
    top: 48%;
    right: -8%;
    transform: translateY(-50%);
    flex-direction: row-reverse;
}

.gtw-label-rim .gtw-label-pointer::after {
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========================================
   Results Section
======================================== */
.gtw-results-container {
    margin-top: 30px;
    padding: 0 20px 20px;
    animation: gtw-fadeIn 0.5s ease;
}

@keyframes gtw-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gtw-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.gtw-results-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gtw-text-dark);
    margin: 0;
}

.gtw-results-count {
    background: var(--gtw-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.gtw-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.gtw-product-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gtw-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.gtw-product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.gtw-product-brand {
    font-size: 11px;
    color: var(--gtw-primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.gtw-product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gtw-text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.gtw-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--gtw-secondary);
}

.gtw-product-stock {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.gtw-product-stock.in_stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.gtw-product-stock.out_of_stock {
    background: #ffebee;
    color: #c62828;
}

/* ========================================
   Loading Overlay
======================================== */
.gtw-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 999;
}

.gtw-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 188, 212, 0.2);
    border-top-color: var(--gtw-primary);
    border-radius: 50%;
    animation: gtw-spin 0.8s linear infinite;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1024px) {
    .gtw-widget-wrapper {
        grid-template-columns: 1fr;
    }
    
    .gtw-right-section {
        padding: 20px;
    }
    
    .gtw-tire-image-wrapper {
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .gtw-tire-widget-container {
        border-radius: 12px;
    }
    
    .gtw-left-section {
        padding: 20px;
    }
    
    .gtw-widget-title {
        font-size: 22px;
    }
    
    .gtw-season-tabs {
        flex-wrap: wrap;
    }
    
    .gtw-season-tab {
        flex: 1 1 calc(50% - 5px);
    }
    
    .gtw-size-selectors-top {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .gtw-search-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
    
    .gtw-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gtw-widget-subtitle {
        font-size: 12px;
    }
    
    .gtw-season-tab {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .gtw-size-select {
        font-size: 14px;
        padding: 8px 30px 8px 12px;
    }
    
    .gtw-size-selectors-top {
        grid-template-columns: 1fr;
    }
}
