/* Greek Scent Category System - Frontend Styles */

/* Main scent selection wrapper */
.gscs-scent-selection-wrapper {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fafafa;
    clear: both;
    width: 100%;
    box-sizing: border-box;
}

/* Scent field styling */
.gscs-scent-field {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.gscs-scent-field:last-child {
    margin-bottom: 0;
}

.gscs-scent-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.gscs-scent-field .required {
    color: #d63638;
}

/* Category selection styling */
.gscs-scent-categories {
    margin-bottom: 15px;
    width: 100%;
}

.gscs-category-select,
.gscs-scent-dropdown-field select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    padding: 12px 45px 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s ease;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    display: block;
}

/* Scent dropdown styling */
.gscs-scent-dropdown-field {
    opacity: 1;
    max-height: none;
    overflow: visible;
    transition: all 0.4s ease;
    display: block !important;
    width: 100%;
    box-sizing: border-box;
}

.gscs-scent-dropdown-field.gscs-hidden {
    display: none !important;
}

.gscs-scent-dropdown-field.gscs-visible {
    display: block !important;
    opacity: 1;
    max-height: none;
    margin-top: 15px;
}

/* Force full width - override any theme styles */
.woocommerce .gscs-scent-selection-wrapper,
.woocommerce .gscs-scent-field,
.woocommerce .gscs-category-select,
.woocommerce .gscs-scent-dropdown-field select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Ensure container takes full width */
.single-product .gscs-scent-selection-wrapper {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override WooCommerce form styling */
.woocommerce form .gscs-category-select,
.woocommerce form .gscs-scent-dropdown-field select {
    width: 100% !important;
    display: block !important;
}

.gscs-category-select:focus,
.gscs-scent-dropdown-field select:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, #b17457);
    box-shadow: 0 0 0 3px rgba(var(--wp--preset--color--primary-rgb, 0, 115, 170), 0.1);
}

.gscs-category-select option:disabled,
.gscs-scent-dropdown-field select option:disabled {
    color: #999;
    font-style: italic;
}

/* Scent description styling */
.gscs-scent-description {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid var(--wp--preset--color--primary, #b17457);
    border-radius: 4px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gscs-scent-description.gscs-visible {
    opacity: 1;
    max-height: 200px;
}

.gscs-description-content {
    color: #555;
    line-height: 1.6;
    font-style: italic;
}

.gscs-description-content::before {
    content: "💫 ";
    margin-right: 5px;
}

/* Loading states */
.gscs-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.gscs-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #b17457;
    border-radius: 50%;
    animation: gscs-spin 1s linear infinite;
}

@keyframes gscs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart and checkout styles */
.gscs-cart-scent-info {
    color: var(--wp--preset--color--primary, #b17457);
    font-weight: 500;
}

.gscs-scent-category {
    color: #666;
    font-weight: normal;
}

.gscs-cart-scent-description {
    margin-top: 5px;
    padding-left: 15px;
    border-left: 2px solid var(--wp--preset--color--primary, #b17457);
}

.gscs-mini-cart-scent {
    margin-top: 5px;
    font-size: 12px;
}

.gscs-mini-cart-scent small {
    color: #666;
}

/* Order scent info */
.gscs-order-scent-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #b17457;
}

.gscs-order-scent-info small {
    color: #555;
}

/* Error and validation styles */
.gscs-error {
    color: #d63638;
    background: #fef7f7;
    border: 1px solid #f1b2b2;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.gscs-warning {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.gscs-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .gscs-scent-selection-wrapper {
        margin: 15px 0;
        padding: 15px;
    }
    
    .gscs-category-select,
    .gscs-scent-dropdown-field select {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gscs-scent-selection-wrapper {
        margin: 10px 0;
        padding: 12px;
    }
    
    .gscs-category-select,
    .gscs-scent-dropdown-field select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .gscs-scent-description {
        padding: 12px;
        margin-top: 12px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .gscs-category-label,
    .gscs-scent-dropdown-field,
    .gscs-scent-description,
    .gscs-loading::after {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gscs-category-select,
    .gscs-scent-dropdown-field select {
        border-width: 3px;
    }
    
    .gscs-category-select:focus,
    .gscs-scent-dropdown-field select:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px #000;
    }
}

/* Print styles */
@media print {
    .gscs-scent-selection-wrapper {
        border: 1px solid #000;
        background: #fff;
    }
    
    .gscs-category-select,
    .gscs-scent-dropdown-field select {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}