/* ===================================
   BGW Diaper Calculator — Frontend CSS
   Color Palette from BabyGearWise.com
   =================================== */

/* CSS Variables */
:root {
    /* Accents */
    --bgw-sage: #5B8A72;
    --bgw-clay: #D4A574;
    --bgw-sky: #7BA3B8;

    /* Contrast */
    --bgw-deep-forest: #2D3A3A;
    --bgw-slate: #4A5859;
    --bgw-warm-grey: #7A8685;
    --bgw-pale-stone: #C8CCC9;

    /* Base */
    --bgw-linen: #E8E5DF;
    --bgw-cloud-cream: #F3F1ED;
    --bgw-white: #FFFFFF;

    /* Notices */
    --bgw-success: #6A9E7F;
    --bgw-warning: #E8C47A;
    --bgw-error: #C98B8B;
    --bgw-info: #7BA3B8;
    --bgw-neutral: #A8A39D;

    /* Backgrounds */
    --bgw-site-bg: #F5F3EF;

    /* Buttons */
    --bgw-btn-default: #5B8A72;
    --bgw-btn-hover: #4A7660;

    /* Shadows */
    --bgw-shadow-sm: 0 1px 3px rgba(45, 58, 58, 0.08);
    --bgw-shadow-md: 0 4px 12px rgba(45, 58, 58, 0.1);
    --bgw-shadow-lg: 0 8px 30px rgba(45, 58, 58, 0.12);

    /* Border Radius */
    --bgw-radius-sm: 8px;
    --bgw-radius-md: 12px;
    --bgw-radius-lg: 16px;
    --bgw-radius-xl: 20px;
}

/* ---- WRAPPER ---- */
.bgw-dc-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--bgw-slate);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.bgw-dc-wrapper *, .bgw-dc-wrapper *::before, .bgw-dc-wrapper *::after {
    box-sizing: border-box;
}

/* ---- HEADER ---- */
.bgw-dc-header {
    background: linear-gradient(135deg, var(--bgw-sage) 0%, #4A7660 100%);
    color: var(--bgw-white);
    text-align: center;
    padding: 40px 30px 35px;
    border-radius: var(--bgw-radius-xl) var(--bgw-radius-xl) 0 0;
    position: relative;
    overflow: hidden;
}

.bgw-dc-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.bgw-dc-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.bgw-dc-header-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.bgw-dc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--bgw-white) !important;
    letter-spacing: -0.3px;
}

.bgw-dc-subtitle {
    font-size: 15px;
    opacity: 0.92;
    margin: 0;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ---- FORM SECTION ---- */
.bgw-dc-form-section {
    background: var(--bgw-white);
    padding: 35px 30px;
    border-left: 1px solid var(--bgw-pale-stone);
    border-right: 1px solid var(--bgw-pale-stone);
}

.bgw-dc-form-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.bgw-dc-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bgw-deep-forest);
    margin-bottom: 10px;
}

.bgw-dc-label-icon {
    font-size: 20px;
}

.bgw-dc-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bgw-pale-stone);
    border-radius: var(--bgw-radius-sm);
    font-size: 15px;
    color: var(--bgw-slate);
    background: var(--bgw-cloud-cream);
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    appearance: none;
    -webkit-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 d='M6 8L1 3h10z' fill='%234A5859'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.bgw-dc-select:focus {
    outline: none;
    border-color: var(--bgw-sage);
    box-shadow: 0 0 0 3px rgba(91, 138, 114, 0.15);
}

/* ---- TIER CARDS ---- */
.bgw-dc-tier-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .bgw-dc-tier-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bgw-dc-tier-card {
    cursor: pointer;
    display: block;
}

.bgw-dc-tier-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bgw-dc-tier-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 10px;
    border: 2px solid var(--bgw-pale-stone);
    border-radius: var(--bgw-radius-md);
    background: var(--bgw-cloud-cream);
    transition: all 0.25s ease;
    text-align: center;
}

.bgw-dc-tier-card:hover .bgw-dc-tier-content {
    border-color: var(--bgw-sage);
    background: var(--bgw-white);
    transform: translateY(-2px);
    box-shadow: var(--bgw-shadow-md);
}

.bgw-dc-tier-card input[type="radio"]:checked + .bgw-dc-tier-content {
    border-color: var(--bgw-sage);
    background: rgba(91, 138, 114, 0.08);
    box-shadow: 0 0 0 3px rgba(91, 138, 114, 0.15);
}

.bgw-dc-tier-icon {
    font-size: 28px;
}

.bgw-dc-tier-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--bgw-deep-forest);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bgw-dc-tier-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--bgw-sage);
}

.bgw-dc-tier-examples {
    font-size: 11px;
    color: var(--bgw-warm-grey);
    line-height: 1.3;
}

/* ---- CALCULATE BUTTON ---- */
.bgw-dc-button-wrap {
    margin-top: 30px;
    text-align: center;
}

.bgw-dc-calculate-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--bgw-btn-default);
    color: var(--bgw-white);
    font-size: 17px;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(91, 138, 114, 0.35);
    letter-spacing: 0.2px;
}

.bgw-dc-calculate-btn:hover {
    background: var(--bgw-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 138, 114, 0.45);
}

.bgw-dc-calculate-btn:active {
    transform: translateY(0);
}

.bgw-dc-btn-icon {
    font-size: 22px;
}

/* ---- RESULTS SECTION ---- */
.bgw-dc-results {
    background: var(--bgw-white);
    border-left: 1px solid var(--bgw-pale-stone);
    border-right: 1px solid var(--bgw-pale-stone);
    border-bottom: 1px solid var(--bgw-pale-stone);
    border-radius: 0 0 var(--bgw-radius-xl) var(--bgw-radius-xl);
    padding: 0 30px 35px;
    animation: bgwFadeIn 0.5s ease;
}

@keyframes bgwFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bgw-dc-results-title {
    text-align: center;
    font-size: 22px;
    color: var(--bgw-deep-forest);
    margin: 30px 0 20px;
    padding-top: 25px;
    border-top: 2px solid var(--bgw-linen);
}

/* ---- SUMMARY CARDS ---- */
.bgw-dc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 650px) {
    .bgw-dc-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bgw-dc-summary-card {
    background: var(--bgw-cloud-cream);
    border-radius: var(--bgw-radius-md);
    padding: 20px 15px;
    text-align: center;
    border: 1px solid var(--bgw-pale-stone);
    transition: transform 0.2s;
}

.bgw-dc-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--bgw-shadow-md);
}

.bgw-dc-card-icon {
    font-size: 30px;
    margin-bottom: 6px;
}

.bgw-dc-card-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--bgw-deep-forest);
    line-height: 1.2;
}

.bgw-dc-card-total .bgw-dc-card-value { color: var(--bgw-sage); }
.bgw-dc-card-cost .bgw-dc-card-value { color: var(--bgw-clay); }
.bgw-dc-card-monthly .bgw-dc-card-value { color: var(--bgw-sky); }
.bgw-dc-card-daily .bgw-dc-card-value { color: var(--bgw-sage); }

.bgw-dc-card-label {
    font-size: 12px;
    color: var(--bgw-warm-grey);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ---- BREAKDOWN TABLE ---- */
.bgw-dc-breakdown {
    margin-top: 35px;
}

.bgw-dc-breakdown h3 {
    font-size: 20px;
    color: var(--bgw-deep-forest);
    margin-bottom: 6px;
}

.bgw-dc-breakdown-desc {
    font-size: 14px;
    color: var(--bgw-warm-grey);
    margin-bottom: 16px;
}

.bgw-dc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bgw-dc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bgw-dc-table th {
    background: var(--bgw-sage);
    color: var(--bgw-white);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bgw-dc-table th:first-child {
    border-radius: var(--bgw-radius-sm) 0 0 0;
}

.bgw-dc-table th:last-child {
    border-radius: 0 var(--bgw-radius-sm) 0 0;
}

.bgw-dc-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--bgw-linen);
    color: var(--bgw-slate);
}

.bgw-dc-table tbody tr:hover {
    background: var(--bgw-cloud-cream);
}

.bgw-dc-table tbody tr:nth-child(even) {
    background: rgba(243, 241, 237, 0.5);
}

.bgw-dc-table tbody tr:nth-child(even):hover {
    background: var(--bgw-cloud-cream);
}

.bgw-dc-total-row {
    background: var(--bgw-linen) !important;
}

.bgw-dc-total-row td {
    padding: 14px;
    font-size: 15px;
    border-bottom: none;
    color: var(--bgw-deep-forest);
}

/* ---- COMPARISON SECTION ---- */
.bgw-dc-comparison {
    margin-top: 35px;
}

.bgw-dc-comparison h3 {
    font-size: 20px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-comparison-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 16px;
}

@media (min-width: 650px) {
    .bgw-dc-comparison-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bgw-dc-compare-card {
    padding: 18px;
    border-radius: var(--bgw-radius-md);
    text-align: center;
    border: 2px solid var(--bgw-pale-stone);
    background: var(--bgw-white);
    transition: all 0.2s;
}

.bgw-dc-compare-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bgw-shadow-md);
}

.bgw-dc-compare-card.active {
    border-color: var(--bgw-sage);
    background: rgba(91, 138, 114, 0.06);
}

.bgw-dc-compare-card .tier-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.bgw-dc-compare-card .tier-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--bgw-deep-forest);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bgw-dc-compare-card .tier-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--bgw-sage);
    margin: 6px 0;
}

.bgw-dc-compare-card .tier-per-diaper {
    font-size: 12px;
    color: var(--bgw-warm-grey);
}

.bgw-dc-compare-card .tier-savings {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bgw-success);
    background: rgba(106, 158, 127, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-block;
}

/* ---- ECO SECTION ---- */
.bgw-dc-eco-section {
    margin-top: 35px;
    background: var(--bgw-cloud-cream);
    border-radius: var(--bgw-radius-lg);
    padding: 30px;
    border: 1px solid var(--bgw-pale-stone);
}

.bgw-dc-eco-section h3 {
    font-size: 20px;
    color: var(--bgw-deep-forest);
    margin-top: 0;
}

.bgw-dc-eco-grid {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .bgw-dc-eco-grid {
        flex-direction: column;
        align-items: center;
    }
}

.bgw-dc-eco-card {
    flex: 1;
    padding: 24px;
    border-radius: var(--bgw-radius-md);
    background: var(--bgw-white);
    border: 2px solid var(--bgw-pale-stone);
    text-align: center;
}

.bgw-dc-eco-card h4 {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-eco-cost {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.bgw-dc-eco-card.disposable .bgw-dc-eco-cost { color: var(--bgw-clay); }
.bgw-dc-eco-card.cloth .bgw-dc-eco-cost { color: var(--bgw-sage); }

.bgw-dc-eco-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.bgw-dc-eco-card ul li {
    padding: 5px 0;
    font-size: 13px;
    color: var(--bgw-slate);
    border-bottom: 1px solid var(--bgw-linen);
}

.bgw-dc-eco-card ul li:last-child {
    border-bottom: none;
}

.bgw-dc-eco-vs {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--bgw-warm-grey);
    padding: 0 5px;
}

.bgw-dc-eco-savings {
    margin-top: 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--bgw-success);
    background: rgba(106, 158, 127, 0.1);
    padding: 12px 20px;
    border-radius: var(--bgw-radius-sm);
}

/* ---- SUBSCRIPTIONS ---- */
.bgw-dc-subscriptions {
    margin-top: 35px;
}

.bgw-dc-subscriptions h3 {
    font-size: 20px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-sub-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.bgw-dc-sub-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bgw-cloud-cream);
    border: 1px solid var(--bgw-pale-stone);
    border-radius: var(--bgw-radius-md);
    transition: all 0.2s;
    flex-wrap: wrap;
    gap: 12px;
}

.bgw-dc-sub-card:hover {
    border-color: var(--bgw-sage);
    box-shadow: var(--bgw-shadow-sm);
}

.bgw-dc-sub-info {
    flex: 1;
    min-width: 200px;
}

.bgw-dc-sub-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-sub-savings {
    font-size: 13px;
    color: var(--bgw-success);
    margin-top: 2px;
}

.bgw-dc-sub-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--bgw-btn-default);
    color: var(--bgw-white) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 50px;
    transition: background 0.2s;
    white-space: nowrap;
}

.bgw-dc-sub-btn:hover {
    background: var(--bgw-btn-hover);
    color: var(--bgw-white) !important;
}

/* ---- SIZE CHART ---- */
.bgw-dc-size-chart {
    margin-top: 35px;
}

.bgw-dc-size-chart h3 {
    font-size: 20px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-size-table tbody tr td:first-child {
    font-weight: 700;
    color: var(--bgw-sage);
}

/* ---- CTA BANNER ---- */
.bgw-dc-cta-banner {
    margin-top: 35px;
    background: linear-gradient(135deg, var(--bgw-sage) 0%, #4A7660 100%);
    color: var(--bgw-white);
    border-radius: var(--bgw-radius-lg);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bgw-dc-cta-banner::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.bgw-dc-cta-content h3 {
    font-size: 22px;
    margin: 0 0 8px;
    color: var(--bgw-white) !important;
}

.bgw-dc-cta-content p {
    opacity: 0.92;
    margin: 0 0 16px;
    font-size: 14px;
}

.bgw-dc-cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--bgw-clay);
    color: var(--bgw-white) !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}

.bgw-dc-cta-btn:hover {
    background: #C49564;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.5);
    color: var(--bgw-white) !important;
}

/* ---- AFFILIATE LINK CARDS ---- */
.bgw-dc-aff-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bgw-cloud-cream);
    border: 1px solid var(--bgw-pale-stone);
    border-radius: var(--bgw-radius-sm);
    margin: 6px;
    transition: all 0.2s;
}

.bgw-dc-aff-card:hover {
    border-color: var(--bgw-sage);
    box-shadow: var(--bgw-shadow-sm);
}

.bgw-dc-aff-card img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.bgw-dc-aff-card-brand {
    font-weight: 700;
    font-size: 13px;
    color: var(--bgw-deep-forest);
}

.bgw-dc-aff-card-link {
    font-size: 12px;
    color: var(--bgw-sage);
    text-decoration: none;
    font-weight: 600;
}

.bgw-dc-aff-card-link:hover {
    text-decoration: underline;
}

/* ---- AFFILIATE CONTAINERS ---- */
.bgw-dc-affiliate-top,
.bgw-dc-affiliate-bottom,
.bgw-dc-affiliate-eco,
.bgw-dc-affiliate-size,
.bgw-dc-affiliate-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

/* ---- ACTION BUTTONS ---- */
.bgw-dc-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.bgw-dc-action-btn {
    padding: 12px 24px;
    background: var(--bgw-linen);
    color: var(--bgw-slate);
    border: 1px solid var(--bgw-pale-stone);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bgw-dc-action-btn:hover {
    background: var(--bgw-pale-stone);
    color: var(--bgw-deep-forest);
}

/* ---- SEO CONTENT ---- */
.bgw-dc-seo-content {
    margin-top: 35px;
    padding: 30px;
    background: var(--bgw-cloud-cream);
    border-radius: var(--bgw-radius-lg);
    border: 1px solid var(--bgw-pale-stone);
}

.bgw-dc-seo-content h3 {
    font-size: 18px;
    color: var(--bgw-deep-forest);
    margin-top: 20px;
}

.bgw-dc-seo-content h3:first-child {
    margin-top: 0;
}

.bgw-dc-seo-content p {
    font-size: 14px;
    color: var(--bgw-slate);
    line-height: 1.7;
}

/* ---- PRINT STYLES ---- */
@media print {
    .bgw-dc-wrapper {
        max-width: 100%;
    }
    .bgw-dc-header {
        background: var(--bgw-sage) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .bgw-dc-form-section,
    .bgw-dc-actions,
    .bgw-dc-cta-banner,
    .bgw-dc-affiliate-top,
    .bgw-dc-affiliate-bottom,
    .bgw-dc-affiliate-eco,
    .bgw-dc-affiliate-size,
    .bgw-dc-affiliate-cta,
    .bgw-dc-sub-btn {
        display: none !important;
    }
    .bgw-dc-results {
        display: block !important;
        border: none;
    }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    .bgw-dc-header {
        padding: 30px 20px 25px;
    }
    .bgw-dc-title {
        font-size: 22px;
    }
    .bgw-dc-subtitle {
        font-size: 13px;
    }
    .bgw-dc-form-section {
        padding: 25px 18px;
    }
    .bgw-dc-results {
        padding: 0 18px 25px;
    }
    .bgw-dc-tier-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .bgw-dc-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bgw-dc-card-value {
        font-size: 22px;
    }
    .bgw-dc-calculate-btn {
        padding: 14px 30px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
    .bgw-dc-table {
        font-size: 12px;
    }
    .bgw-dc-table th, .bgw-dc-table td {
        padding: 8px 10px;
    }
    .bgw-dc-eco-section {
        padding: 20px;
    }
}