/* Product Attributes Widget */
.coolair-product-attributes {
    width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Attribute Section with Label Layout */
.coolair-attribute-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.coolair-attribute-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.coolair-attribute-label,
.coolair-quantity-label {
    min-width: 140px;
    flex-shrink: 0;
}

.coolair-label-text {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coolair-attribute-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.coolair-attribute-options::-webkit-scrollbar {
    width: 6px;
}

.coolair-attribute-options::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.coolair-attribute-options::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.coolair-attribute-options::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.coolair-attribute-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.coolair-attribute-button {
    padding: 10px 18px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 6px;
    position: relative;
    outline: none;
    min-width: 120px;
    flex: 0 0 auto;
    line-height: 1.5;
}

.coolair-attribute-button:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #1e40af;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.coolair-attribute-button.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    font-weight: 600;
}

/* Button Styles */
.coolair-attribute-button.outline {
    background-color: transparent;
    border-width: 2px;
}

.coolair-attribute-button.outline:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.coolair-attribute-button.outline.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.coolair-attribute-button.rounded {
    border-radius: 25px;
}

.coolair-attribute-price-diff {
    display: block;
    font-size: 11px;
    font-weight: normal;
    margin-top: 4px;
    opacity: 0.8;
}

.coolair-attribute-button.active .coolair-attribute-price-diff {
    opacity: 0.9;
}

/* Price Section */
.coolair-attribute-price-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.coolair-attribute-price-wrapper {
    margin: 0;
    padding: 12px 0;
}

.coolair-attribute-price {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    display: block;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.coolair-attribute-price .woocommerce-Price-amount {
    font-weight: 700;
}

.coolair-attribute-price del {
    opacity: 0.6;
    margin-right: 8px;
}

.coolair-attribute-price ins {
    text-decoration: none;
    color: #3b82f6;
}

.coolair-price-per-unit {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.7;
    margin-left: 8px;
}

/* Price Animation */
.coolair-attribute-price.price-updated {
    animation: pricePulse 0.3s ease;
}

@keyframes pricePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Quantity Section */
.coolair-quantity-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.coolair-quantity-wrapper {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.coolair-quantity-label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin: 0;
}

.coolair-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.coolair-quantity-button {
    width: 40px;
    height: 40px;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    outline: none;
}

.coolair-quantity-button:hover {
    background-color: #2563eb;
}

.coolair-quantity-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #cccccc;
}

.coolair-quantity-input {
    width: 75px !important;
    height: 40px;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
    background-color: #ffffff;
}

.coolair-quantity-input::-webkit-outer-spin-button,
.coolair-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.coolair-quantity-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .coolair-attribute-buttons {
        gap: 8px;
    }
    
    .coolair-attribute-button {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
    
    .coolair-attribute-price {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .coolair-attribute-button {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .coolair-attribute-price {
        font-size: 18px;
    }
    
    .coolair-attribute-section,
    .coolair-quantity-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .coolair-attribute-label,
    .coolair-quantity-label {
        min-width: auto;
    }
    
    .coolair-quantity-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .coolair-quantity-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .coolair-quantity-input {
        width: 50px;
        height: 35px;
        font-size: 14px;
    }
}

/* Action Buttons */
.coolair-action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.coolair-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 200px !important;
    max-width: 200px !important;
}

.coolair-btn-add-to-cart {
    background-color: #ffffff;
    color: #3b82f6;
    border-color: #3b82f6;
}

.coolair-btn-add-to-cart:hover {
    background-color: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.coolair-btn-buy-now {
    background-color: #3b82f6;
    color: #ffffff !important;
    border-color: #3b82f6;
    flex: 1;
}

.coolair-btn-buy-now:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.coolair-cart-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .coolair-action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .coolair-btn {
        width: 100%;
        padding: 12px 24px;
    }
    
    .coolair-btn-buy-now {
        flex: none;
    }
}

/* ============================================
   Buy Now Modal Styles
   ============================================ */

body.coolair-modal-open {
    overflow: hidden;
}

.coolair-buynow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.coolair-buynow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.coolair-buynow-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: coolair-modal-appear 0.3s ease-out;
}

@keyframes coolair-modal-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.coolair-buynow-close {
    position: absolute;
    padding: 5px 15px !important;
    top: 16px;
    right: 16px;
    width: 16px;
    max-width: 16px !important;
    height: auto !important;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coolair-buynow-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.coolair-buynow-header {
    padding: 24px 24px 0;
    border-bottom: none;
}

.coolair-buynow-title {
    margin: 0 !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1.4em !important;
    letter-spacing: -0.05em !important;
    color: #0F2554 !important;
}

.coolair-buynow-body {
    padding: 20px 24px;
}

.coolair-buynow-product {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.coolair-buynow-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
}

.coolair-buynow-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coolair-buynow-details {
    flex: 1;
    min-width: 0;
}

.coolair-buynow-product-name {
    margin: 0 0 12px;
    font-size: 22px !important;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    white-space: normal !important;
}

.coolair-buynow-attributes {
    margin-bottom: 8px;
}

.coolair-buynow-attr-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 14px;
}

.coolair-buynow-attr-label {
    color: #6b7280;
    font-weight: 500;
}

.coolair-buynow-attr-value {
    color: #111827;
    font-weight: 600;
}

.coolair-buynow-quantity-row {
    display: flex;
    gap: 8px;
    font-size: 14px;
    margin-top: 8px;
}

.coolair-buynow-qty-label {
    color: #6b7280;
    font-weight: 500;
}

.coolair-buynow-qty-value {
    color: #111827;
    font-weight: 600;
}

.coolair-buynow-price-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 0;
}

.coolair-buynow-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coolair-buynow-price-label {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

.coolair-buynow-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #0369a1;
}

.coolair-buynow-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
}

.coolair-buynow-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.coolair-buynow-btn-cancel {
    background: #f3f4f6;
    color: #374151 !important;
}

.coolair-buynow-btn-cancel:hover {
    background: #e5e7eb;
    color: #374151 !important;
}

.coolair-buynow-btn-confirm {
    background-color: #3b82f6;
    color: #ffffff !important;
    border: 1px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.coolair-buynow-btn-confirm:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Success State */
.coolair-modal-success .coolair-buynow-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1.4em !important;
    letter-spacing: -0.05em !important;
    color: #0F2554 !important;
}

.coolair-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

.coolair-buynow-btn-view-cart {
    background: #f3f4f6;
    color: #374151;
}

.coolair-buynow-btn-view-cart:hover {
    background: #e5e7eb;
    color: #374151;
}

.coolair-buynow-btn-checkout {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.coolair-buynow-btn-checkout:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: #ffffff !important;
}

/* Loading State */
.coolair-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.coolair-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: coolair-spin 0.8s linear infinite;
}

@keyframes coolair-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .coolair-buynow-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .coolair-buynow-product {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .coolair-buynow-image {
        width: 120px;
        height: 120px;
    }
    
    .coolair-buynow-attr-row,
    .coolair-buynow-quantity-row {
        justify-content: center;
    }
    
    .coolair-buynow-footer {
        flex-direction: column;
    }
    
    .coolair-buynow-btn {
        width: 100%;
    }
}
