/**
 * Public styles for Peptide Calculator
 */

.peptide-calculator-container {
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.peptide-calculator-title {
    text-align: center;
    padding: 20px;
    background-color: #007D71;
    color: #fff;
    font-weight: 700;
}
    

.peptide-calculator-step {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.peptide-calculator-step h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.peptide-calculator-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.peptide-calculator-field {
    margin: 0 15px;
    position: relative;
}

.weeks-selection-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.weeks-radio-option {
    flex: 0 0 auto;
}

.weeks-radio-option input[type="radio"] {
    display: none;
}

.weeks-radio-option label {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.discount-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e53935;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: scale(1);
    transition: transform 0.2s ease;
}

.weeks-radio-option:hover .discount-badge {
    transform: scale(1.1);
}

.weeks-radio-option input[type="radio"]:checked + label {
    background-color: #007D71;
    color: white;
    border-color: #007D71;
}

.weeks-radio-option label:hover {
    background-color: #e5e5e5;
}

.weeks-radio-option input[type="radio"]:checked + label:hover {
    background-color: #007D71;
}

.peptide-calculator-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

.peptide-calculator-field input {
    width: 100%;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 0 5px;
}

.peptide-calculator-field small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

.peptide-calculator-results {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 30px;
}

.peptide-options-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.peptide-options-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    min-width: 800px; /* Ensures table doesn't get too squished */
}

.peptide-options-table th,
.peptide-options-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.peptide-options-table th {
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}
.peptide-options-table thead{
    background-color: #11c95c;
}

.peptide-options-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.peptide-options-table tr:hover {
    background-color: #f1f1f1;
}

/* Make the first column sticky for better mobile experience */
.peptide-options-table td:first-child,
.peptide-options-table th:first-child {
    position: sticky;
    left: 0;
    background-color: inherit;
    z-index: 5;
}

.peptide-options-table .select-peptide-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.peptide-options-table .select-peptide-btn:hover {
    background-color: #005177;
}

.peptide-calculator-result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.peptide-calculator-result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #444;
}

.result-value {
    font-weight: 700;
    color: #0073aa;
}

.peptide-calculator-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

#add-to-cart-button {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    background-color: #11c95c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

#add-to-cart-button:hover {
    background-color: #007D71;
    transform: translateY(-2px);        
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#add-to-cart-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.peptide-calculator-summary {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.peptide-calculator-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #444;
}

.summary-value {
    font-weight: 700;
    color: #0073aa;
}

.treatment-details {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.treatment-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
}

.card-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px;
    background: #f5f5f5;
    font-weight: 600;
    margin: 0;
}

.total-card .card-content {
    background: #11c95c;
    color: white;
}

.total-card .card-value {
    color: white;
    font-size: 2em;
}

.total-card .card-label {
    background: #007D71;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

/* Peptide Options Cards Styling */
.peptide-options-cards-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.peptide-options-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

/* Peptide Card Styling */
.peptide-card {
    flex: 0 0 calc(25% - 20px);
    min-width: 200px;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
}

.peptide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.peptide-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    visibility: hidden;
}

.peptide-card.selected {
    border: 2px solid #11c95c;
    box-shadow: 0 5px 15px rgba(17, 201, 92, 0.3);
    transform: translateY(-5px);
}

.peptide-card.selected:after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #11c95c;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.peptide-card-content {
    padding: 20px;
    text-align: center;
}

.peptide-card-image-container {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.peptide-card-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.peptide-card h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.peptide-card p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.discount-message {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-error {
    display: none;
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 0;
}

.peptide-calculator-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
}

.peptide-calculator-message.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.peptide-calculator-message.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Treatment Details Styling */
.treatment-details {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
    width: 100%;
    box-sizing: border-box;
}

.treatment-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* Quantity input styling */
.quantity-input {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 200px;
}

.quantity-input input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
    width: 60px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin: 0;
}

.quantity-input input[type="number"]::-webkit-inner-spin-button,
.quantity-input input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    width: 40px;
    height: 48px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.minus-btn {
    border-radius: 4px 0 0 4px;
}

.plus-btn {
    border-radius: 0 4px 4px 0;
}

.quantity-btn:hover {
    background-color: #e5e5e5;
}

.quantity-btn:active {
    background-color: #d5d5d5;
}

/* Sex field styling */
.peptide-calculator-field select#sex {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #fff;
    padding: 0 10px;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23333' 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 10px center;
    background-size: 16px;
    cursor: pointer;
}

.peptide-calculator-field select#sex:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.peptide-calculator-field select#sex option {
    padding: 10px;
}

/* Custom weeks container styling */
.custom-weeks-container {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
}

.custom-weeks-container label {
    margin-right: 10px;
    margin-bottom: 0 !important;
}

#custom-weeks-input {
    display: none;
    align-items: center;
}

#custom-weeks-input.active {
    display: flex !important;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background-color: #f5f5f5;
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

#treatment-weeks {
    width: 50px;
    border: none !important;
    text-align: center;
    padding: 0 !important;
    min-height: 30px !important;
    box-shadow: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .peptide-calculator-step {
        padding: 15px;
    }
    .peptide-calculator-container {
        padding: 8px;
    }
    .peptide-calculator-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .peptide-calculator-actions {
        justify-content: center;
    }
    #add-to-cart-button {
        width: 100%;
        max-width: 300px;
        padding: 16px 20px;
        font-size: 18px;
    }
    .peptide-calculator-section {
        padding: 15px;
    }
    .treatment-details-grid {
        grid-template-columns: 1fr;
    }
    .peptide-calculator-field {
        margin: 0;
    }
    .peptide-options-table-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }
}

@media (max-width: 992px) {
    .peptide-card {
        flex-basis: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .peptide-card {
        flex-basis: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .peptide-card {
        flex-basis: 100%;
        margin-right: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    
    .peptide-card-image-container {
        width: 80px;
        height: 80px;
        min-width: 80px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .peptide-card-content {
        padding: 10px;
        flex-grow: 1;
    }
    
    .peptide-card-content h4 {
        margin-top: 0;
    }
    
    .peptide-card input[type="radio"] {
        position: relative;
        top: auto;
        right: auto;
        margin-right: 10px;
    }
}
