/* ============================================================
   Cubic Promote — sample-orders.css
   Sample order popup. Loaded ONLY on single product pages.
   ============================================================ */

.sample-order-container { margin: 20px 0; }
.sample-order-button {
    border: none; padding: 12px 24px; font-size: 16px;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    color: #f9a32f; text-decoration: none; font-weight: 600;
}
.sample-order-button:hover { transform: translateY(-1px); }

/* Popup Overlay */
.sample-popup-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); z-index: 999999;
    display: none; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; margin: 0;
}
.sample-popup-overlay.show { display: flex; }

.sample-popup-content {
    background: #fff; border-radius: 8px; max-width: 900px; width: 100%;
    min-height: 550px; max-height: 95vh; overflow: hidden; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column;
}

.sample-popup-body { display: flex; flex-direction: row; flex: 1; }
.sample-popup-left { flex: 1; padding: 0; overflow: visible; }
.sample-popup-right {
    width: 320px; min-width: 320px; background: #f8f9fa;
    border-left: 1px solid #eee; padding: 5px 10px;
    display: flex; flex-direction: column; align-items: center; overflow-y: auto;
}

.product-image-container { margin-bottom: 5px; }
.product-image-container img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.product-title { font-size: 18px; font-weight: 600; color: #333; margin-bottom: 8px; line-height: 1.3; text-align: center; }
.product-price { font-size: 16px; color: #e74c3c; font-weight: 600; margin-bottom: 5px; text-align: center; }
.delivery-info { font-size: 12px; color: #666; font-style: italic; text-align: center; }

.sample-note {
    margin-top: 5px; padding: 5px; background: #fff3cd;
    border: 1px solid #ffeaa7; border-radius: 4px;
    font-size: 10px; color: #856404; text-align: center; line-height: 1.2;
}

/* Header */
.sample-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid #eee;
    background: #f8f9fa; border-radius: 8px 8px 0 0; position: relative; width: 100%;
}
.sample-popup-header h3 { margin: 0; font-size: 24px; color: #333; font-weight: 600; }
.sample-popup-close {
    position: absolute; top: 15px; right: 20px; font-size: 28px; color: #999;
    cursor: pointer; line-height: 1; padding: 5px; transition: color 0.3s;
    background: none; border: none; z-index: 1000;
}
.sample-popup-close:hover { color: #333; }

/* Form */
.sample-order-form { padding: 15px 20px; }
.form-row { display: flex; gap: 10px; margin-bottom: 12px; }
.form-group { flex: 1; display: flex; flex-direction: column; }
.form-group.full-width { flex: 1 1 100%; }
.form-group.half-width { flex: 1 1 calc(50% - 10px); }
.form-group.third-width { flex: 1 1 calc(33.333% - 14px); }
.form-group label { font-weight: 600; margin-bottom: 4px; color: #333; font-size: 13px; }
.form-group .required { color: #e74c3c; }

.sample-popup-content input[type=text],
.sample-popup-content input[type=email],
.sample-popup-content input[type=tel],
.sample-popup-content select {
    padding: 8px 12px; appearance: none; -webkit-appearance: none;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px; transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff; width: 100%; box-sizing: border-box;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center; background-repeat: no-repeat;
    background-size: 16px 12px; padding-right: 30px; cursor: pointer;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #0073aa; box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}
.form-group input.error, .form-group select.error { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231,76,60,0.1); }

.address-note { color: #666; font-size: 12px; margin-top: 4px; font-style: italic; }
.form-note { color: #666; font-size: 13px; line-height: 1.5; margin-top: 12px; }

.form-actions { margin-top: 15px; text-align: center; }
.submit-sample-btn {
    background: #27ae60; color: #fff; border: none; padding: 12px 30px;
    font-size: 16px; font-weight: 600; border-radius: 4px; cursor: pointer;
    transition: all 0.3s; min-width: 200px;
}
.submit-sample-btn:hover { background: #219a52; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.submit-sample-btn:disabled { background: #95a5a6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Messages */
.form-message { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-weight: 500; }
.success-message { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error-message { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

body.sample-popup-open { overflow: hidden; }

/* Loading */
.submit-sample-btn.loading { position: relative; color: transparent; }
.submit-sample-btn.loading::after {
    content: ""; position: absolute; width: 20px; height: 20px;
    top: 50%; left: 50%; margin: -10px 0 0 -10px;
    border: 2px solid #fff; border-radius: 50%; border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (min-width: 768px) { .sample-popup-left { overflow-y: auto; max-height: 70vh; } }

@media (max-width: 768px) {
    .sample-popup-overlay { padding: 5px; }
    .sample-popup-content { max-height: 95vh; flex-direction: column; max-width: 95vw; overflow-y: auto; padding-bottom: 20px; }
    .sample-popup-body { flex-direction: column; overflow-y: scroll; }
    .sample-popup-left { overflow-y: visible; max-height: 70vh; }
    .sample-popup-right { width: 100%; min-width: auto; border-left: none; border-top: 1px solid #eee; order: -1; padding: 15px; overflow: visible; }
    .sample-popup-header { padding: 15px 20px; }
    .sample-popup-header h3 { font-size: 18px; }
    .sample-order-form { padding: 15px; }
    .form-row { flex-direction: column; gap: 8px; margin-bottom: 8px; }
    .form-group.half-width, .form-group.third-width { flex: 1 1 100%; }
    .form-group input, .form-group select { padding: 8px 10px; font-size: 14px; }
    .submit-sample-btn { width: 100%; padding: 12px 20px; font-size: 16px; }
    .product-image-container img { max-width: 150px; height: auto; }
}

@media (max-width: 480px) {
    .sample-popup-overlay { padding: 0; }
    .sample-popup-content { border-radius: 0; max-height: 100vh; max-width: 100vw; }
}
