/* ==========================================================================
   1. FRONTEND OPTION FIELDS (Inputs & Swatches)
   ========================================================================== */
.po-options-container {
    margin-bottom: 25px;
    padding: 0;
    border: none;
    clear: both;
}

.po-field-wrapper {
    margin-bottom: 25px;
}

.po-field-wrapper .po-field-title {
    font-size: 1.1em;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
    text-align: left;
    color: #333;
}

/* Required Asterisk */
.po-field-wrapper .required {
    color: #d63638;
    margin-left: 2px;
    text-decoration: none;
}

.po-field-wrapper input[type="text"],
.po-field-wrapper input[type="number"],
.po-field-wrapper textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.po-field-wrapper ul.po-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

/* --- Radio Buttons (Button Style) --- */
.po-options-list--radio:not(.has-images) input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

.po-options-list--radio:not(.has-images) label {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.95em;
}

.po-options-list--radio:not(.has-images) label:hover {
    background-color: #f9f9f9;
    border-color: #bbb;
}

.po-options-list--radio:not(.has-images) input[type="radio"]:checked + label {
    background-color: #f0f7ff;
    border-color: #0073aa;
    color: #0073aa;
    font-weight: 600;
    box-shadow: 0 0 0 1px #0073aa;
}

/* --- Image Swatches --- */
.po-options-list--radio.has-images {
    gap: 15px;
}

.po-options-list--radio.has-images input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

.po-options-list--radio.has-images label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 90px;
}

.po-options-list--radio.has-images label:hover {
    border-color: #999;
}

.po-options-list--radio.has-images input[type="radio"]:checked + label {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px #0073aa;
}

.po-option-image {
    width: 100%;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

.po-option-label {
    font-size: 0.9em;
    line-height: 1.3;
    text-align: center;
    display: block;
}

.po-option-price {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
}

/* --- Checkboxes --- */
.po-options-list--checkbox li {
    width: 100%;
    margin-bottom: 5px;
}

.po-options-list--checkbox label {
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   2. SLIDABLE GALLERY SLIDER
   ========================================================================== */
#po-gallery-container {
    width: 100%;
    margin-bottom: 30px;
}

#po-gallery-main {
    position: relative;
    border: 1px solid #f2f2f2;
    overflow: hidden; /* Belt container */
    margin-bottom: 12px;
    background: #fff;
    cursor: grab;
    border-radius: 4px;
}

#po-gallery-main:active {
    cursor: grabbing;
}

#po-gallery-main-inner {
    display: flex;
    width: 100%;
    transition: transform 0.4s ease-out; /* Controlled by JS */
}

.po-gallery-main-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.po-gallery-main-slide img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Thumbnail Strip */
#po-gallery-thumbs {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

#po-gallery-thumbs-inner {
    display: flex;
    gap: 10px;
}

.po-gallery-thumb-slide {
    display: none; /* Controlled by JS Grouping */
    min-width: 80px;
    width: 80px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.po-gallery-thumb-slide:hover {
    opacity: 1;
    border-color: #ddd;
}

.po-gallery-thumb-slide.active {
    border-color: #0073aa;
    opacity: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.po-gallery-thumb-slide img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* Custom Scrollbar for Thumbs */
#po-gallery-thumbs::-webkit-scrollbar {
    height: 5px;
}

#po-gallery-thumbs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#po-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

#po-gallery-thumbs::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==========================================================================
   3. RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 480px) {
    .po-options-list--radio.has-images label {
        width: 75px;
    }
    .po-gallery-thumb-slide {
        min-width: 65px;
        width: 65px;
    }
}