/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Neutral, professional color palette */
    --text-main: #0F1111;
    --text-muted: #565959;
    --border: #D5D9D9;
    --bg-body: #FFFFFF;
    --bg-header: #232F3E; /* Sleek dark header */
    --link: #007185;
    --stock-color: #007600;
    
    /* Brand buttons */
    --btn-primary: #FFD814;
    --btn-primary-hover: #F7CA00;
    
    --container-max: 1200px;
    --radius: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #C40000;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Header */
.site-header {
    background-color: var(--bg-header);
    color: #FFFFFF;
    padding: 14px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cart-placeholder {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Announcement Bar (Mini Hero) */
.announcement-bar {
    background-color: #F8F9FA;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.announcement-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.announcement-content p {
    font-weight: 500;
    font-size: 0.95rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-outline-dark {
    background-color: transparent;
    border-color: var(--text-main);
    color: var(--text-main);
}

.btn-outline-dark:hover {
    background-color: #F3F4F6;
    text-decoration: none;
    color: var(--text-main);
}

.btn-buy {
    background-color: var(--btn-primary);
    color: var(--text-main);
    width: 100%;
    padding: 12px 16px;
    border-color: transparent;
    box-shadow: 0 2px 5px rgba(15, 17, 17, 0.15);
    font-weight: 600;
    margin: 16px 0;
}

.btn-buy:hover:not(:disabled) {
    background-color: var(--btn-primary-hover);
    text-decoration: none;
    color: var(--text-main);
}

.btn-buy:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Page Layout */
.page-content {
    padding: 40px 20px;
}

/* Product Section Details */
.product-layout {
    display: grid;
    grid-template-columns: 35% 1fr 280px; /* Image | Details | Buy Box */
    gap: 32px;
}

/* Image */
.product-image-col {
    position: relative;
}

.image-wrapper {
    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Text info */
.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.product-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.price-block {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.price-old {
    font-size: 1.15rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: #B12704;
}

.shipping-fee {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.discount-badge {
    font-size: 0.85rem;
    color: #C40000;
    background-color: #FFF3F3;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #FFDCDC;
    align-self: center;
}

.price-justification {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.product-description p {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.features-list {
    margin-left: 20px;
    font-size: 0.95rem;
}

.features-list li {
    margin-bottom: 8px;
}

/* Buy Box */
.product-buy-col {
    position: relative;
}

.buy-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--bg-body);
}

.buy-box-price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #B12704;
}

.buy-box .shipping-fee {
    margin-bottom: 12px;
}

.stock-status {
    color: var(--stock-color);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.delivery-info {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 16px;
}

.delivery-label {
    font-weight: 600;
}

.secure-payment {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    justify-content: center;
    margin-bottom: 12px;
}

.seller-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.merchant-name {
    color: var(--link);
    font-weight: 500;
}

/* How it Works */
.how-it-works-section {
    margin-top: 60px;
}

.section-divider {
    margin: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 600;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.step-item {
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    background-color: #F8F9FA;
}

.step-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 8px;
}

.step-number {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.step-body {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Footer */
.site-footer {
    background-color: var(--bg-header);
    color: #FFFFFF;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-details p {
    font-size: 0.9rem;
    color: #D5D9D9;
    margin-bottom: 8px;
}

.footer-link {
    color: #FFFFFF;
}

.legal-mention {
    margin-top: 16px;
    font-size: 0.8rem !important;
    opacity: 0.7;
    max-width: 600px;
}

.copyright {
    margin-top: 24px;
    text-align: center;
    opacity: 0.7;
}

/* =====================================================
   SPINNER & LOADING STATES
   ===================================================== */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

.stock-loading {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stock-out {
    color: #B12704;
    font-weight: 600;
}

.stock-error {
    color: #B12704;
    font-size: 0.9rem;
}

/* =====================================================
   SUCCESS PAGE
   ===================================================== */

.success-card {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
    padding: 48px 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #FAFBFC;
    animation: fadeInUp 0.5s ease-out;
}

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

.success-icon {
    margin-bottom: 20px;
    color: var(--stock-color);
}

.success-icon svg {
    animation: scaleIn 0.4s ease-out 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.success-message {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

.success-details {
    text-align: left;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.btn-back {
    margin-top: 8px;
    padding: 10px 24px;
}

/* =====================================================
   QUANTITY BLOCK
   ===================================================== */

.quantity-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 16px 0;
}

.qty-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

#qty {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

#qty:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.15);
}

#qty:disabled {
    background-color: #F3F4F6;
    cursor: not-allowed;
}

/* spinner arrows (optional cleaner look) */
#qty::-webkit-outer-spin-button,
#qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-error {
    font-size: 0.85rem;
    color: #B12704;
    min-height: 1.2em;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr 280px; /* Details | Buy Box */
    }
    
    .product-image-col {
        grid-column: 1 / -1; /* spans all columns */
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }

    .announcement-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .steps-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .success-card {
        margin: 20px auto;
        padding: 32px 20px;
    }
}