/* Design a Unit Form Styles - Matches Rental Checkout Styling */

.wh-design-a-unit-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wh-design-base-unit {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}


.wh-design-base-unit-name {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.wh-design-base-unit-description {
    margin: 0 0 10px 0;
    color: #6c757d;
    line-height: 1.6;
    font-size: 14px;
}

.wh-design-base-unit-link {
    margin: 10px 0 0 0;
}

.wh-design-base-unit-link a {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
}

.wh-design-base-unit-link a:hover {
    text-decoration: underline;
}

.wh-design-form-wrapper {
    display: grid;
    grid-template-columns: calc(40% - 20px) calc(60% - 20px);
    gap: 40px;
    align-items: start;
}

.wh-design-form-left {
    min-width: 300px;
}

.wh-design-form-right {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

/* Section styling to match wh-ptm-section */
.wh-design-section {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wh-design-section-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.wh-design-section-header:hover {
    background: #e9ecef;
}

.wh-design-section-title {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
    flex: 1;
}

.wh-design-section-count {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background: #e9ecef;
    border-radius: 12px;
    padding: 4px 10px;
    min-width: 24px;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-design-section-count:not(:empty) {
    display: inline-block;
}

.wh-design-saved-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #212529;
}

.wh-design-saved-name {
    font-weight: 600;
}

.wh-design-not-you-link {
    color: #007cba;
    text-decoration: underline;
    cursor: pointer;
}

.wh-design-not-you-link:hover {
    text-decoration: none;
}

.wh-design-section-content {
    display: none;
    padding: 20px;
}

.wh-design-section-content.wh-design-section-active {
    display: block;
}

/* Customer Details Fields */
.wh-design-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.wh-design-row-full {
    grid-template-columns: 1fr;
}

.wh-design-row-three {
    grid-template-columns: 2fr 1fr 1fr;
}

.wh-design-row:last-child {
    margin-bottom: 0;
}

.wh-design-field {
    display: flex;
    flex-direction: column;
}

.wh-design-field label {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
}

.wh-design-field input,
.wh-design-field select {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wh-design-field input:focus,
.wh-design-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.wh-design-field-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    line-height: 1.4;
}

.wh-design-selections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wh-design-selections-dropdown {
    padding: 20px;
}

.wh-design-selection-dropdown {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.wh-design-selection-dropdown:hover {
    border-color: #007cba;
}

.wh-design-selection-dropdown:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.wh-design-selection {
    position: relative;
    margin: 0;
    margin-bottom: 12px;
}

.wh-design-selection:last-child {
    margin-bottom: 0;
}

.wh-design-selection-label {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wh-design-selection-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wh-design-selection-label:hover {
    border-color: #007cba;
}

.wh-design-selection-input:checked + .wh-design-selection-text,
.wh-design-selection-input:checked ~ .wh-design-selection-text {
    font-weight: 500;
}

.wh-design-selection-label.wh-design-selection-checked {
    border-color: #007cba;
}

.wh-design-selection-input {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.wh-design-selection-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    color: #212529;
    font-size: 16px;
    font-weight: 500;
    padding-left: 10px;
}

.wh-design-selection-price {
    margin-left: auto;
    color: #212529;
    font-weight: 600;
    font-size: 16px;
}

.wh-design-selection-description-toggle {
    display: block;
    margin-top: 8px;
    margin-left: 30px;
    font-size: 12px;
    color: #d4a574;
    text-decoration: none;
    cursor: pointer;
}

.wh-design-selection-description-toggle:hover {
    text-decoration: underline;
}

.wh-design-selection-description {
    margin-top: 8px;
    margin-left: 30px;
    margin-right: 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

.wh-design-selection-description p {
    margin: 0 0 8px 0;
}

.wh-design-selection-description p:last-child {
    margin-bottom: 0;
}

/* Custom Cargo Image and Color Options */
.wh-design-custom-cargo-image-wrapper {
    margin-bottom: 20px;
    max-width: 100%;
}

.wh-design-custom-cargo-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.wh-design-image-overlay-container {
    background: #fff;
    border-radius: 8px;
    max-width: 100%;
    overflow: hidden;
}

.wh-design-image-overlay-wrapper {
    position: relative;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    /* 800x600 aspect ratio = 75% padding-bottom (600/800 = 0.75) */
    padding-bottom: 75%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hide any picture or img tags that might be added by image optimization plugins */
.wh-design-image-overlay-wrapper picture,
.wh-design-image-overlay-wrapper img.wh-design-base-image {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure all child elements are absolutely positioned to fill the wrapper */
.wh-design-image-overlay-wrapper > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wh-design-base-image {
    /* Base image div with background image - always top-most */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.wh-design-mask-overlay-image {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.wh-design-overlay-image {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.wh-design-color-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: transparent;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: background-color 0.3s ease;
}

.wh-design-overlay-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.wh-design-overlay-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.wh-design-color-boxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wh-design-color-box {
    width: 40px;
    height: 40px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.wh-design-color-box:hover {
    border-color: #007cba;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wh-design-color-box.wh-design-color-box-active {
    border-color: #007cba;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* No Color option styling */
.wh-design-color-box-no-color {
    background-color: #ffffff !important;
    border-color: #6c757d;
}

.wh-design-color-box-no-color svg {
    width: 24px;
    height: 24px;
    color: #6c757d;
    stroke: currentColor;
}

.wh-design-color-box-no-color:hover {
    border-color: #495057;
}

.wh-design-color-box-no-color:hover svg {
    color: #495057;
}

.wh-design-color-box-no-color.wh-design-color-box-active {
    border-color: #007cba;
    background-color: #ffffff !important;
}

.wh-design-color-box-no-color.wh-design-color-box-active svg {
    color: #007cba;
}

/* Price Summary - matches rental checkout summary styling */
.wh-design-price-summary {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wh-design-price-summary-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.wh-design-selected-options {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
}

.wh-design-selected-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wh-design-selected-option-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 14px;
    color: #212529;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.wh-design-selected-option-item:last-child {
    border-bottom: none;
}

.wh-design-selected-option-name {
    flex: 1;
    min-width: 0; /* Allows text to wrap */
}

.wh-design-selected-option-section {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.wh-design-selected-option-label {
    font-weight: 500;
}

.wh-design-selected-option-price {
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
}

.wh-design-selected-option-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wh-design-edit-selection-link,
.wh-design-delete-selection-link {
    color: #007cba;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}

.wh-design-edit-selection-link:hover,
.wh-design-delete-selection-link:hover {
    text-decoration: underline;
}

.wh-design-delete-selection-link {
    color: #dc3545;
}

.wh-design-price-display {
    display: table;
    width: 100%;
}

.wh-design-price-row {
    display: table-row;
}

.wh-design-price-label {
    display: table-cell;
    padding: 12px 0;
    color: #212529;
    font-size: 14px;
    vertical-align: middle;
}

.wh-design-price-value {
    display: table-cell;
    text-align: right;
    padding: 12px 0;
    color: #212529;
    font-size: 18px;
    font-weight: 600;
    vertical-align: middle;
}

.wh-design-price-row.wh-design-price-total {
    border-top: 2px solid #212529;
    padding-top: 16px;
}

.wh-design-price-row.wh-design-price-total .wh-design-price-label,
.wh-design-price-row.wh-design-price-total .wh-design-price-value {
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
}

.wh-design-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wh-design-submit-button,
.wh-design-review-quote-button {
    width: 100%;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.wh-design-submit-button:hover,
.wh-design-review-quote-button:hover {
    background: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none!important;
    color: #fff!important;
}

.wh-design-submit-button:active,
.wh-design-review-quote-button:active {
    background: #222;
    color: #fff!important;
    border: none!important;
}


.wh-design-cta-secondary {
    width: 100%;
    padding: 9px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    background: #fff;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    display: block;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wh-design-cta-secondary:hover {
    background: #212529;
    color: #fff;
}

.wh-design-location-selector {
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid #dee2e6;
}

.wh-design-location-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
}

.wh-design-location-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.wh-design-location-select:hover {
    border-color: #007cba;
}

.wh-design-location-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.wh-design-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.wh-design-cta-reset {
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    background: transparent;
    border: none;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s;
    display: block;
    box-sizing: border-box;
    text-decoration: none;
}

.wh-design-cta-reset:hover {
    color: #495057;
    text-decoration: underline;
}

.wh-design-cta-reset {
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    background: transparent;
    border: none;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s;
    display: block;
    box-sizing: border-box;
    text-decoration: none;
}

.wh-design-cta-reset:hover {
    color: #495057;
    text-decoration: underline;
}

.wh-design-next-section-button {
    width: 100%;
    margin-top: 20px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.wh-design-next-section-button:hover {
    background: #333;
    color: #fff!important;
    border: none!important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wh-design-next-section-button:active {
    background: #222;
    color: #fff!important;
    border: none!important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .wh-design-form-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .wh-design-form-right {
        position: static;
    }
    
    .wh-design-image-overlay-wrapper {
        max-width: 100%;
        /* Maintain 800x600 aspect ratio with padding-bottom */
        padding-bottom: 75%;
    }
    
    .wh-design-image-overlay-wrapper > * {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 1200px) {
    .wh-design-form-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .wh-design-form-right {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
        padding: 10px 0 20px 0;
        margin-bottom: 20px;
        order: -1; /* Move image to top on mobile */
    }
    
    /* Hide CTA buttons in sticky area on mobile to save space */
    .wh-design-form-right .wh-design-cta-buttons {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    
    .wh-design-custom-cargo-image-wrapper {
        /* Parent container is now sticky, so remove sticky from here */
        position: relative;
        top: auto;
        z-index: auto;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    .wh-design-image-overlay-container {
        position: relative;
    }
    
    .wh-design-cta-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .wh-design-image-overlay-container {
        width: 100% !important;
    }
    
    .wh-design-image-overlay-wrapper {
        max-width: 100%;
        /* Maintain 800x600 aspect ratio with padding-bottom */
        padding-bottom: 75%;
    }
    
    .wh-design-image-overlay-wrapper > * {
        width: 100%;
        height: 100%;
    }
    
    .wh-design-price-summary {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .wh-design-a-unit-form {
        padding: 15px;
    }
}
