/**
 * Partner Discounts Professional Layout Styles
 * Two-column layout with sticky sidebar and responsive design
 * Matches the review page styling with discount-specific features
 */

/* === Main Layout Structure === */
.partner-discount-content {
    background: #ffffff;
    padding: 40px 0;
}

.discount-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.discount-main-content {
    flex: 1;
    min-width: 65%;
    max-width: 100%;
}

.discount-sidebar {
    flex-basis: 320px;
    flex-grow: 0;
    flex-shrink: 0;
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--roc-sticky-top, 0px) + 20px);
    align-self: flex-start;
    height: fit-content;
}

/* === Post Header Styling === */
.discount-title {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.discount-meta {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* === Sidebar Promotional Box === */
.discount-promo-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #2563eb;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.discount-promo-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.discount-promo-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
}

.discount-promo-box h4 {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.discount-promo-box .service-description {
    color: #666;
    font-size: 1rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.discount-promo-box .services-info {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    text-align: left;
}

.discount-promo-box .services-info h5 {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-promo-box .services-info p {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* === Promo Box CTA Buttons === */
.promo-cta-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    margin-bottom: 10px;
}

.promo-cta-button:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    color: #ffffff !important;
}

.promo-coupon-button {
    background: #ffffff;
    border: 2px solid #2563eb;
    color: #2563eb !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    position: relative;
}

.promo-coupon-button:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

.promo-coupon-button .coupon-code-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
}

.promo-coupon-button .copy-indicator {
    background: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.promo-coupon-button.copied::after {
    content: "COPIED!";
    position: absolute;
    left: 50%;
    top: -35px;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: fadeInOut 1.5s forwards;
    z-index: 10;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-5px); }
}

/* === Discount Details === */
.discount-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.discount-details small {
    color: #28a745;
    font-weight: 500;
    font-size: 0.85rem;
    background: rgba(40, 167, 69, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* === Table of Contents === */
.discount-toc {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-height: 70vh;
    overflow-y: auto;
}

.discount-toc h3 {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.discount-toc ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.discount-toc li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
}

.discount-toc li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.discount-toc li:hover:before {
    transform: translateX(3px);
}

.discount-toc a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: color 0.2s ease;
    display: block;
}

.discount-toc a:hover {
    color: #2563eb;
    text-decoration: none;
}

.discount-toc .toc-h3 {
    margin-left: 15px;
    font-size: 0.9rem;
    color: #666;
}

.discount-toc .toc-h3:before {
    content: "◦";
    font-size: 1rem;
}

.discount-toc a.active {
    color: #2563eb !important;
    font-weight: 600 !important;
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
}

/* === Main Content Coupon Section === */
.coupon-instructions-section {
    background: #f8f9fa;
    border: 2px solid #2563eb;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.coupon-instructions-section h5 {
    color: #2563eb;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.coupon-action-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
}

/* No-code variant - centered, compact */
.coupon-instructions-section.no-code {
    text-align: center;
}

.coupon-instructions-section.no-code .coupon-action-row {
    justify-content: center;
}

.coupon-instructions-section.no-code .coupon-instructions {
    margin-top: 8px;
}

.coupon-instructions-section.no-code .coupon-instructions p {
    margin-bottom: 0;
}

.coupon-action-button {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 2px solid #2563eb;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    gap: 15px;
}

.coupon-action-button:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.coupon-action-button .coupon-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coupon-action-button .coupon-icon {
    width: 20px;
    height: 20px;
}

.coupon-action-button .coupon-code-text {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.coupon-action-button .action-text {
    background: #2563eb;
    color: white;
    padding: 6px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.get-discount-button {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white !important;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
}

.get-discount-button:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white !important;
}

.coupon-instructions {
    margin-top: 10px;
}

.coupon-instructions p {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.coupon-code-inline {
    background: #EFF2F6;
    display: inline-block;
    padding: 4px 8px;
    border: 1px dotted #2563eb;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #2563eb;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* === Main Content Typography === */
.discount-main-content h1,
.discount-main-content h2,
.discount-main-content h3,
.discount-main-content h4 {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.discount-main-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 0.5rem;
    scroll-margin-top: 80px;
}

.discount-main-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    scroll-margin-top: 80px;
}

.discount-main-content p {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    font-size: 17px;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.discount-main-content ul,
.discount-main-content ol {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    font-size: 17px;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.discount-main-content li {
    margin-bottom: 0.5rem;
}

.discount-main-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.discount-main-content table th {
    background: #2563eb;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.discount-main-content table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.discount-main-content table tr:nth-child(even) {
    background: #f8f9fa;
}

.discount-main-content table tr:hover {
    background: #e3f2fd;
}

/* === WordPress Block Button Fix === */
.discount-main-content .wp-block-button__link {
    background: linear-gradient(145deg, #2563eb, #1e40af) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 48px !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
    transition: all 0.3s ease !important;
    line-height: 1.5 !important;
}

.discount-main-content .wp-block-button__link:hover {
    background: linear-gradient(145deg, #1e40af, #1e3a8a) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    color: #ffffff !important;
}

.discount-main-content .wp-block-button {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
    .discount-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
    }

    .discount-main-content {
        min-width: 100%;
        order: 2;
    }

    .discount-sidebar {
        position: static;
        width: 100%;
        order: 1;
        margin-bottom: 30px;
    }

    .discount-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .discount-promo-box,
    .discount-toc {
        padding: 20px;
    }

    .discount-main-content h2 {
        font-size: 1.5rem;
    }

    .discount-main-content h3 {
        font-size: 1.25rem;
    }

    .discount-main-content p,
    .discount-main-content ul,
    .discount-main-content ol {
        font-size: 16px;
    }

    .coupon-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .coupon-action-button,
    .get-discount-button {
        width: 100%;
        justify-content: center;
    }

    .discount-toc {
        display: none;
    }

    .coupon-instructions-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* The sidebar promo box reorders to the top on mobile and already carries
       the primary CTA — hiding the duplicate button row here leaves ONE clear
       action above the fold. The written instructions below it remain. */
    .coupon-instructions-section .coupon-action-row {
        display: none;
    }

    /* De-emphasize the ACF subtitle: it restates the H1 on mobile. */
    .discount-meta .lead {
        font-size: 0.95rem;
        color: #6b7280;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .partner-discount-content {
        padding: 20px 0;
    }

    .discount-container {
        padding: 0 10px;
    }

    .discount-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .discount-title {
        font-size: 1.75rem;
    }

    .discount-promo-box,
    .discount-toc {
        padding: 15px;
        margin-bottom: 20px;
    }

    .promo-cta-button {
        padding: 12px 15px;
        font-size: 15px;
    }

    .discount-promo-box h4 {
        font-size: 1.25rem;
    }

    .coupon-instructions-section h5 {
        font-size: 1.1rem;
    }
}

/* === Loading Animation === */
.discount-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Accessibility === */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* === Related Partner Discounts Section === */
.related-discounts-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.related-discounts-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.5rem;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.related-discounts-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.related-discounts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.related-discount-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
}

.related-discount-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
}

.related-card-link {
    text-decoration: none;
    display: block;
    height: 100%;
}

.related-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-card-image {
    height: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

.related-card-image img {
    max-width: 80%;
    max-height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.related-discount-card:hover .related-card-image img {
    transform: scale(1.1);
}

.related-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.related-discount-card:hover .related-card-title {
    color: #2563eb;
}

.related-card-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.related-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.related-card-badge {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-card-arrow {
    color: #2563eb;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.related-discount-card:hover .related-card-arrow {
    transform: translateX(5px);
}

/* === Related Discounts Responsive === */
@media (max-width: 1200px) {
    .related-discounts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .related-discounts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .related-discounts-section {
        margin-top: 40px;
        padding-top: 30px;
    }

    .related-discounts-title {
        font-size: 1.5rem;
    }

    .related-discounts-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .related-discounts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .related-card-image {
        height: 100px;
    }

    .related-card-content {
        padding: 15px;
    }

    .related-card-title {
        font-size: 1rem;
    }

    .related-card-description {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .related-discounts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .related-discounts-section {
        margin-top: 30px;
        padding-top: 20px;
    }

    .related-discounts-title {
        font-size: 1.3rem;
    }

    .related-discounts-subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }

    .related-card-image {
        height: 120px;
    }

    .related-discount-card:hover {
        transform: translateY(-4px);
    }
}