/* Main Content */
.main-content {
    grid-column: 2;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    padding: 10px;
    overflow-x: hidden;
}

.white-section,
.white-section.book-content,
.white-section.price-summary,
.notice,
.order {
    width: calc(100% - 48px);
    max-width: 800px;
    margin: 0 auto 1rem;
    padding: 8px 24px 8px 24px;
    background: white;
    box-sizing: border-box;
    padding: 20px; 
}

.notice {
    margin: 0 auto 0.5rem;
    padding: 12px 24px; 
}

/* Common white sections */
.book-content,
.price-summary {
    background: white;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto 1.5rem;
}

/* Notice Components */
.notice-title {
    color: #6b46c1;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.notice h3 {
    margin-top: 0;
}

.notice p {
    margin-top: 0.1rem;
}

.notice ul {
    list-style: none;
    padding: 0;
    margin: 0.1rem 0 0 0;
}

.notice li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #4a5568;
}

.notice li:not([class^="indent"]) {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.indent {
    margin-left: 3rem;
    margin-bottom: 0.5rem; 
}

.notice li:last-child,
.notice li.indent:last-of-type {
    margin-bottom: 1rem;
}

/* Notice Types */
.about-notice {
    border-left: 4px solid #475569;
}

.sale-notice {
    border-left: 4px solid #3b82f6;
}

.returns-notice {
    border-left: 4px solid #6b46c1;
}

.about-notice .notice-title {
    color: #475569;
}

.sale-notice .notice-title {
    color: #3b82f6;
}

.returns-notice .notice-title {
    color: #6b46c1;
}

.notice-title {
    margin-bottom: 0.5rem;
}

/*currency conversion*/
.currency-message-container {
    text-align: center;
    color: #666;
    margin: 8px 0;
    cursor: pointer;
}

.currency-message {
    cursor: pointer;
}

.currency-info {
    display: flex;
    align-items: baseline;
    justify-content: center; 
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.currency-selector {
    position: relative;
    display: inline-block;
    min-width: 100px;
    max-width: 120px;
    margin: 0;
    cursor: default;
}

.currency-input {
    width: 100%;
    padding: 2px 20px 2px 8px; 
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 0px center;
    cursor: pointer;
    height: 24px;
}

.currency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    margin-top: 4px;
    min-width: 80px;
}

.currency-option {
    padding: 8px 12px;
    cursor: pointer;
}

.currency-option:hover {
    background: #f5f5f5;
}

.converted-price {
    color: #666;
    min-width: 100px; 
    white-space: nowrap;
}

.hr-gradient {
    border: none;
    height: 1px;
    background: linear-gradient(to right, #eee, #ccc, #eee);
    margin: 20px 0;
}

.price-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Order Types */

.order.order-choice {
    margin-top: 1.5rem;
}

.order-choice,
.order-show,
.order-pay {
    border-left: white;
}

.order-show {
    padding: 30px 20px;
}

.order-choice {
    margin-top: 1rem;
}

.order-choice .volume h3 {
    margin: 0.3rem auto 1rem auto;
}

/* Links and Text Styles */
.booklinker-link {
    color: #2563eb;
    text-decoration: underline;
}

.orange-text {
    color: #f59e0b;
    font-weight: bold;
}

em {
    color: #6b7280;
    font-style: italic;
}

/* Product Display */
.volume {
    margin: 0  auto;
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.product-info {
    display: grid;
    grid-template-columns: 
        160px    /* Format */
        100px    /* Original price */
        100px    /* Discount badge */
        180px     /* Discounted price & Converted price */ 
        160px;   /* Quantity group */
    align-items: center;
    gap: 1rem;
}

.format-selection {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.format-info {
    width: 140px;
    white-space: nowrap;
}

.quantity-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 140px;
    white-space: nowrap;
    justify-self: start; 
}

.original-price {
    text-decoration: line-through;
    color: #666;
    white-space: nowrap;
    width: 90px; 
}

.discount-price {
    color: #0d766d;
    font-weight: 500;
    white-space: nowrap;
    width: 70px; 
}

.discount-badge {
    background-color: #dc2626;
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    justify-self: center;
    text-align: center;
    width: fit-content;
    vertical-align: middle;
    line-height: 1.2; 
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input {
    height: auto;
    max-height: 24px;
    padding: 6px 10px;
    box-sizing: border-box;
    line-height: 1.2;
    vertical-align: middle;
    width: 4rem; 
}

.quantity-input:focus {
    border-color: #635bff;
    outline: none;
}

.quantity-input:invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Order Summary Section */
.book-order {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.book-order label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.price-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.bundle-info,
.reference-warning {
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    border-radius: 6px;
    text-align: center;
    color: #4b5563;
}

.shipping-warning {
    margin: 0 0 2rem 0;
    padding: 0;
    background: #f3f4f6;
    border-radius: 6px;
    text-align: center;
    color: #4b5563;
    font-style: italic;
}

/* Payment Form */
.checkout-section {
    text-align: center;
    margin: 20px 0;
}

#payment-form {
    margin-top: 2rem;
}

.payment-button {
    display: none; 
    background-color: #0A5C36;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 25%;
    white-space: nowrap; 
    transition: background-color 0.3s ease;
    margin: 1rem auto 0 auto;
}

.payment-button:hover {
    background-color: #1E7748;
}

.payment-button:disabled {
    opacity: 0.5;
    background: #cccccc;
    cursor: not-allowed;
}

#payment-element {
    margin-top: 24px;
}

.icon {
    font-size: 18px;
}

/* Messages and Alerts */
.info-message {
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 10px;
    border: 1px solid #90caf9;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
}

.payment-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    display: none;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}


/* Trust bar */
.trust-bar {
    display: grid;
    gap: 8px;
    margin: 0 40px 16px 40px;
    max-width: 800px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
}

.trust-item:hover,
.trust-item:focus-visible {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,.2);
}

.trust-item .icon,
.trust-item svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex: 0 0 20px;
}

/* Trust bar text blocks: title + subtext */
.trust-text {
    display: inline;            /* mobile-first: inline to save vertical space */
    line-height: 1.25;
    min-width: 0;
}
.trust-title,
.trust-sub {
    display: inline;
}
.trust-title {
    font-weight: 600;
    color: inherit;
}
.trust-sub {
    opacity: .9;
}
/* Inline separator on narrow screens */
.trust-title::after {
    content: " — ";
    font-weight: 400;
    opacity: .7;
}

/* From medium screens up: stack to two lines */
@media (min-width: 700px) {
    .trust-text { display: flex; flex-direction: column; }
    .trust-title, .trust-sub { display: block; }
    .trust-title::after { content: none; }
}

/* Accordion */
.accordion {
    display: grid;
    gap: 12px;
}
.accordion-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: clip;
    margin-left: 40px;
    margin-right: 40px; 
    max-width: 800px;
}

.accordion-trigger {
    appearance: none;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    cursor: pointer;
}

.accordion-trigger:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(59,130,246,.35);
    border-radius: 5px;
}

.accordion-trigger .icon,
.accordion-trigger svg { width: 22px; height: 22px; color: #3b82f6; }
.accordion-title { font-weight: 600; margin: 0; color: #111827; }
.accordion-summary { margin-top: 2px; font-size: .95rem; color: #4a5568; }
.chevron { width: 18px; height: 18px; transform: rotate(0deg); transition: transform 200ms ease; color: #6b7280; margin-top: 3px; }
.accordion-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.accordion-panel {
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px 16px 48px;
}

.accordion-panel[hidden] { display: none !important; }

/* Optional: color accents per section (matches your .about/.sale/.returns colors) */
.accordion-item[data-color="blue"] .accordion-trigger .icon { color: #3b82f6; }
.accordion-item[data-color="orange"] .accordion-trigger .icon { color: #f59e0b; }
.accordion-item[data-color="purple"] .accordion-trigger .icon { color: #6b46c1; }

/* Lists inside accordion panels (keep bullets) */
.accordion-panel ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc; 
}

.accordion-panel li {
    margin: 6px 0; 
    color: #4a5568;
}

/* Responsive Design */

@media (max-width: 1024px) {
    .product-info {
        grid-template-columns: 
            140px  /* Format */
            80px   /* Original price */
            90px   /* Discount badge */
            180px  /* Discounted price & Converted price */
            120px; /* Quantity group */
        gap: 0.5rem;
    }
}


@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .order-choice .volume h3 {
        margin: 0.3rem auto;
    }
    
    .format-info, .price-group, .quantity-group {
        font-size: 0.9rem;
    }

    .quantity-input {
        height: 40px;
        min-width: 60px;
    }
    
    .quantity-group label {
        display: flex;
        align-items: center;
    }

    .product-info {
        grid-template-columns: 1fr 1fr 0.05fr 2.3fr 0.8fr;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .product-info .format-info {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .product-info .original-price {
        grid-column: 1;
        justify-self: start;
    }

    .product-info .discount-badge {
        grid-column: 2;
        justify-self: center;
    }

    .product-info .price-group {
        grid-column: 4;
        display: flex;
        justify-content: space-between;
    }

    .product-info .quantity-group {
        grid-column: 5;
        justify-self: center;
        margin-top: 0.25rem;
    }
}

@media (max-width: 640px) {
    .main-content {
        width: 100%;
        max-width: 100%;    
        margin: 0 auto;  
        padding: 10px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .sections {
        width: 100%;
        padding: 0 1rem;  
        margin: 0;   
        box-sizing: border-box;
    }

    .order,
    .notice {
        width: 100% !important;
        margin: 0rem 0 !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
    }
    
    .white-section {
        width: 100% !important;
        margin: 1rem 0 !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    .white-section.price-summary,
    .white-section.book-content {
        width: 100%;
        margin: 1rem 0;
        padding: 1rem;
        box-sizing: border-box;
    }

    /* Other notices and warnings */
    .shipping-warning,
    .bundle-info,
    .reference-warning {
        padding: 0.2rem;
        margin: 0.2rem 0;
        max-width: 100%;
        width: calc(100% - 2rem); /* leaves 1rem space on both sides */
        border-radius: 6px;
        background-color: #f1f3f5;
        line-height: 1.4;
        text-align: center;
    }
    
    .payment-button {
        font-size: 14px; 
        padding: 10px 15px; 
        width: 90%; 
    }
    
    .price-summary,
    #order-details {
        width: 100% !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
        }

    /* Reset any inherited margins */
    #mainContent > div {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 570px) { 
    .order-choice .volume h3 {
        margin: 0.3rem auto;
    }
    
    .product-info {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .product-info .format-info {
        grid-column: 1 / -1;
    }

    .product-info .original-price {
        grid-column: 1;
    }

    .product-info .discount-badge {
        grid-column: 2;
    }

    .product-info .discount-price {
        grid-column: 1;
    }

    .product-info .converted-price {
        grid-column: 2;
    }

    .product-info .quantity-group {
        grid-column: 1 / -1;
        margin-top: 0.75rem;
        justify-self: start;
    }
}


@media (min-width: 560px) {
    .trust-bar { grid-template-columns: repeat(3, 1fr); }
}

/* Align accordion/trust bar with notice layout */
.accordion-item {
    /* override the earlier 40px side margins */
    margin-left: auto !important;
    margin-right: auto !important;
    width: calc(100% - 48px);
    max-width: 800px;
    box-sizing: border-box;
}

.trust-bar {
    margin: 0 auto 16px auto;            /* center like .notice */
    width: calc(100% - 48px);
    max-width: 800px;
    box-sizing: border-box;
}

/* Improve anchor jumps from trust-bar links if you have a sticky header */
.notice,
.accordion-item {
    scroll-margin-top: 80px; /* adjust if your header height differs */
}

/* Mobile: apply the same collapse rules to accordion + trust bar */
@media (max-width: 640px) {
    .order,
    .notice,
    .accordion-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
    }

    .trust-bar {
        width: 100% !important;
        margin: 0 0 16px 0 !important;
        padding: 0 !important;
        grid-template-columns: 1fr !important; /* stack items */
    }

    .sections {
        padding-left: 0; 
        padding-right: 0;
    }

    /* Slightly tighter panel padding on small screens */
    .accordion-panel { 
        padding: 12px 1rem 16px 2.5rem;
    }
}

/* Keep 3 columns on wider screens */
@media (min-width: 560px) {
    .trust-bar {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ensure link text inside trust items is visible regardless of global link colors */
.trust-bar a.trust-item { color: #111827; }

/* Space between the cart area and the Pricing accordion */
.accordion { margin-top: 12px; } 

/* If you prefer a single source of truth: */
:root { --accordion-gap: 12px; }
.accordion { gap: var(--accordion-gap); margin-top: var(--accordion-gap); }

.book-order + .accordion,
.price-summary + .accordion { margin-top: 12px; }

/* Color of the icons */
:root{
  --acc-green: #16a34a;
  --acc-blue:  #2563eb;
  --acc-orange:#f59e0b;
}

/* Accordion */
.accordion-item[data-color="green"]  .icon { color: var(--acc-green); }
.accordion-item[data-color="blue"]   .icon { color: var(--acc-blue); }
.accordion-item[data-color="orange"] .icon { color: var(--acc-orange); }

/* Trust bar (match the same topics) */
#link-pricing  .icon { color: var(--acc-green); }
#link-shipping .icon { color: var(--acc-blue); }
#link-returns  .icon { color: var(--acc-orange); }

/* Keep link text from turning purple on revisit */
.trust-bar .trust-item:visited { color: inherit; }


/* Stack layout on narrow screens */
@media (max-width: 420px) {
	.currency-info {
		grid-template-columns: 1fr; 
		justify-items: center;
		row-gap: 4px;
		text-align: center;
	}
	.currency-selector {
		width: min(220px, 100%);  
		max-width: 100%;
	}
}