/**
 * Frontend Styles for Storage Unit Manager
 */

/* Single Product Unit Picker */
.sum-product-unit-picker-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 20px 0;
}

.sum-product-unit-picker-box label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.sum-product-unit-picker-box select.sum-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    color: #0f172a;
    transition: border-color 0.2s;
    outline: none;
}

.sum-product-unit-picker-box select.sum-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sum-badge-available-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.sum-pulse-dot {
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    animation: sum-pulse 1.8s infinite;
}

@keyframes sum-pulse {
    0% { transform: scale(0.9); opacity: 0.9; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(0.9); opacity: 0.9; }
}

.sum-picker-hint {
    font-size: 12.5px;
    color: #64748b;
    margin: 8px 0 0 0;
}

.sum-alert-soldout {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* [storage_unit_picker] Shortcode Grid Layout */
.sum-unit-picker-container {
    margin: 30px 0;
}

.sum-picker-header {
    text-align: center;
    margin-bottom: 35px;
}

.sum-picker-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.sum-picker-header p {
    font-size: 16px;
    color: #64748b;
}

.sum-grid-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 25px;
}

.sum-card-unit {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.sum-card-unit:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.sum-card-unit.sum-is-soldout {
    opacity: 0.75;
    background: #f8fafc;
}

.sum-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
}

.sum-card-badge .badge-success {
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.sum-card-badge .badge-soldout {
    background: #64748b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.sum-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sum-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.sum-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 14px;
}

.sum-price-val {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
}

.sum-price-sub {
    font-size: 14px;
    color: #64748b;
}

.sum-card-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.sum-direct-rent-form {
    margin-top: auto;
}

.sum-select-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sum-picker-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 14px;
}

.sum-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.sum-btn-primary {
    background: #0f172a;
    color: #fff;
}

.sum-btn-primary:hover {
    background: #1e293b;
    color: #fff;
}

.sum-btn-disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Checkout Rental Agreement & Signature Section */
.sum-checkout-contract-wrapper {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.sum-contract-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 18px;
}

.sum-contract-header .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2563eb;
}

.sum-contract-header h3 {
    margin: 0 0 4px 0;
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
}

.sum-contract-subtext {
    margin: 0;
    font-size: 13.5px;
    color: #64748b;
}

/* Scrollable document box */
.sum-contract-document {
    background: #fdfdfd;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 22px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.sum-contract-document h2 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.sum-contract-document h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 6px 0;
    color: #1e293b;
}

.sum-fill-target {
    color: #94a3b8;
    font-style: italic;
    transition: color 0.3s;
}

.sum-fill-target.sum-filled {
    color: #1e40af;
    font-weight: 600;
    font-style: normal;
    background: #eff6ff;
    padding: 1px 4px;
    border-radius: 3px;
}

.sum-fill-highlight {
    background: #fef08a;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    color: #854d0e;
}

/* Signature Canvas */
.sum-signature-wrapper h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #0f172a;
}

.sum-sig-instruction {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 10px 0;
}

.sum-canvas-container {
    background: #fff;
    border: 1.5px dashed #94a3b8;
    border-radius: 8px;
    padding: 10px;
    display: inline-block;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

#sum-signature-canvas {
    display: block;
    width: 100%;
    height: 150px;
    background: #fafafa;
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}

.sum-canvas-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.sum-sig-status {
    font-size: 12px;
    color: #64748b;
}

.sum-sig-status.sum-signed-ok {
    color: #16a34a;
    font-weight: 700;
}

.sum-terms-checkbox {
    margin-top: 15px;
    padding: 10px 0;
}

.sum-terms-checkbox label {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.sum-terms-checkbox input[type="checkbox"] {
    margin-top: 3px;
}

/* Thank You and Account box */
.sum-thankyou-contract-box,
.sum-account-contract-action {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
}

.sum-thankyou-contract-box h3,
.sum-account-contract-action h4 {
    margin-top: 0;
    color: #166534;
}

.sum-btn-print {
    background: #166534 !important;
    color: #fff !important;
    font-weight: 600;
    padding: 8px 18px !important;
    border-radius: 6px;
    display: inline-block;
    text-decoration: none;
}

/* v1.1 additions */
.sum-checkout-contract-wrapper input[type="date"],
.sum-checkout-contract-wrapper input[type="text"] { width: 100%; max-width: 360px; }
.sum-checkout-contract-wrapper .sum-contract-document:focus-visible { outline: 3px solid #f0c032; outline-offset: 2px; }
.sum-thankyou-contract-box, .sum-account-contract-action { margin: 20px 0; }

/* Checkout block */
.wc-block-checkout .sum-checkout-contract-wrapper { margin: 24px 0; }
.wc-block-checkout .sum-occupant-representation-wrapper { margin: 24px 0; }
.sum-editor-placeholder { border: 1px dashed #999; padding: 12px 16px; background: #fafafa; }

/* Occupant's Representation Field */
.sum-occupant-representation-wrapper {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.sum-occupant-representation-wrapper .form-row {
    margin: 0;
    padding: 0;
}

.sum-occupant-representation-wrapper label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    font-weight: normal;
}

.sum-occupant-representation-wrapper label strong {
    color: #0f172a;
    font-weight: 700;
}

.sum-occupant-representation-wrapper textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sum-occupant-representation-wrapper textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Keep line breaks the customer types into Occupant's Representation. */
.sum-fill-representation { white-space: pre-line; }
