/* ==========================================================================
   BREADCRUMB STYLING (Responsive & Padded)
   ========================================================================== */
.shop-breadcrumb {
    background-color: #f1f5f9; /* Subtle light gray background, not white */
    padding: 15px 25px;
    border-radius: 8px;
    margin: 20px auto 30px auto;
    max-width: 1200px;
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on mobile screens */
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
}

.shop-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shop-breadcrumb a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.current-category, .current-product {
    color: #0f172a;
    font-weight: 600;
}

/* ==========================================================================
   MAIN STOREFRONT LAYOUT (Desktop First, Mobile Adapted)
   ========================================================================== */
.shop-container {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
    gap: 30px;
    box-sizing: border-box;
}

/* Sidebar Sizing */
.shop-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.shop-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.shop-categories, .shop-categories ul {
    list-style: none;
    padding-left: 0;
}

.shop-categories ul {
    padding-left: 15px;
    margin: 5px 0;
    border-left: 1px solid #e2e8f0; /* Visual hierarchy line */
}

.shop-categories a {
    display: block;
    padding: 6px 0 6px 10px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.shop-categories a:hover, .shop-categories a.active {
    color: #2563eb;
    font-weight: 600;
}

/* Main Shop Content Area */
.shop-main {
    flex: 1;
    min-width: 0; /* Prevents grid blowout on smaller screens */
}

.shop-header {
    margin-bottom: 25px;
}

/* ==========================================================================
   PRODUCT GRID & CARDS
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.product-image-wrapper {
    width: 100%;
    height: 220px;
    background-color: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.store-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.store-product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-summary {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

/* Price & Buy Action Split Row */
.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap; /* Crucial: Allows the button to drop below price if cramped */
    gap: 12px;
}

.store-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

/* Form wrapper to ensure it doesn't break flex layout */
.product-meta-row form {
    margin: 0;
}

.btn-add-cart {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap; /* Prevents text from stacking vertically */
    display: inline-block;
    width: 100%;
}

.btn-add-cart:hover {
    background-color: #1d4ed8;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Media Queries)
   ========================================================================== */

/* Tablet & Smaller Devices */
@media (max-width: 850px) {
    .shop-container {
        flex-direction: column; /* Stacks sidebar on top of products */
        gap: 20px;
    }
    
    .shop-sidebar {
        width: 100%; /* Sidebar takes full width */
        background: #f8fafc;
        padding: 15px;
        border-radius: 8px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr; /* Forces 1 product per row on small phones */
    }

    .shop-breadcrumb {
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    .product-meta-row {
        flex-direction: column;
        align-items: flex-start; /* Stacks price and button */
    }

    .product-meta-row form, .btn-add-cart {
        width: 100%; /* Makes button full width on mobile for easy tapping */
    }
}

/* ==========================================================================
   PRODUCT DETAIL PAGE LAYOUT (product-detail.php)
   ========================================================================== */
.product-detail-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    gap: 50px;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Left Column: Media Showcase */
.detail-media-gallery {
    flex: 1;
    max-width: 550px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.main-display-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

/* Right Column: Details & Cart Action */
.detail-specs-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Critical CSS Fix: Prevents inner flex child from breaking layout boundaries */
    box-sizing: border-box;
}

.detail-sku {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 15px 0;
    line-height: 1.2;
    word-wrap: break-word; /* Critical CSS Fix: Wraps extremely long titles dynamically */
}

.detail-price-box {
    margin-bottom: 25px;
    display: flex;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap; /* Critical CSS Fix: Drops discount badges down on narrow viewports instead of overflowing */
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    color: #2563eb;
}

.old-price {
    font-size: 1.2rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.detail-description {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-description p {
    margin: 0;
    word-break: break-word; /* Fallback wrapping protection for description text blocks */
}

/* Purchase Actions */
.purchase-action-zone {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quantity-selector label {
    font-weight: 600;
    color: #0f172a;
}

.quantity-selector input[type="number"] {
    width: 80px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.btn-purchase-primary {
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-purchase-primary:hover {
    background-color: #1d4ed8;
}

.btn-purchase-primary:active {
    transform: scale(0.98);
}

/* Detail Page Mobile Responsiveness Override Layer */
@media (max-width: 900px) {
    .product-detail-layout {
        flex-direction: column;
        gap: 30px;
    }

    .detail-media-gallery {
        max-width: 100%;
        width: 100%;
    }
    
    .detail-specs-panel {
        width: 100%;
    }
    
    .detail-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .product-detail-layout {
        padding: 0 15px; /* Brings structure closer to edge safely without hard padding hits */
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
    
    .current-price {
        font-size: 1.6rem;
    }
    
    .detail-price-box {
        gap: 8px;
    }
    
    .detail-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .purchase-action-zone {
        padding: 15px;
    }
    
    .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .quantity-selector input[type="number"] {
        width: 100%; /* Makes entry ergonomic for thumbs on mobile devices */
        box-sizing: border-box;
    }
}

/* ==========================================================================
   NATIVE ACCORDION & PAGINATION CUSTOM OVERLAY STYLES
   ========================================================================== */
.sidebar-accordion-toggle {
    display: none;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f5f9;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}
.sidebar-accordion-toggle h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}
.accordion-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #64748b;
}

/* Pagination Container Styles */
.store-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}
.pagination-btn:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    color: #0f172a;
}
.pagination-btn.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
    cursor: default;
}
.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
    color: #94a3b8;
}

.shop-sidebar h6 {
    display: none;  
}

/* Media Query for responsive phone layout mapping */
@media (max-width: 768px) {
    .sidebar-accordion-toggle {
        display: flex; /* Show the accordion trigger on mobile viewports */
    }
    
    .shop-sidebar h6 {
        display: block;  
    }

    .shop-sidebar h3 {
        display: none; /* Hide static sidebar header on mobile */ 
    }
    .shop-category-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    .shop-sidebar.open .shop-category-list {
        max-height: 500px; /* Expands visually when wrapper gets the active state class */
        overflow-y: auto;
    }
    .shop-sidebar.open .accordion-arrow {
        transform: rotate(180deg);
    }
}

/* ==========================================================================
   FLOATING CART BUTTON STYLING
   ========================================================================== */
.floating-cart-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #2563eb;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    text-decoration: none !important;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.floating-cart-wrapper:hover {
    background-color: #1d4ed8;
    transform: scale(1.08);
}

.floating-cart-icon {
    font-size: 24px;
    line-height: 1;
}

.floating-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #ffffff;
    box-sizing: border-box;
}

/* Subtle pulse animation indicator when item gets added */
.cart-pulse {
    animation: badgePulse 0.4s ease-out;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@media (max-width: 480px) {
    .floating-cart-wrapper {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
}

/* ==========================================================================
   CART PAGE LAYOUT STYLING (Responsive Layout Blocks)
   ========================================================================== */
.cart-page-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    gap: 40px;
    align-items: flex-start;
    box-sizing: border-box;
}

.cart-main-content {
    flex: 2;
    min-width: 0;
}

.cart-main-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 25px;
}

/* Cart Table Specific Styling */
.cart-table-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.cart-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.cart-table td {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cart-item-row {
    transition: opacity 0.3s ease;
}

.cart-thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cart-item-title {
    color: #1e293b;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.4;
    display: inline-block;
}

.cart-item-title:hover {
    color: #2563eb;
}

/* Quantity Adjuster Custom Styling */
.cart-qty-adjuster {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    background-color: #f1f5f9;
    color: #0f172a;
    border: none;
    width: 32px;
    height: 36px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background-color: #e2e8f0;
}

.qty-input {
    width: 44px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove Button custom design */
.btn-remove-item {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-remove-item:hover {
    background-color: #fee2e2;
}

/* Cart Utility foot links */
.cart-actions-footer {
    display: flex;
    justify-content: space-between;
}

.btn-secondary-link {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.btn-secondary-link:hover {
    color: #0f172a;
}

/* Summary Panel Card */
.cart-summary-panel {
    flex: 1;
    min-width: 320px;
    position: sticky;
    top: 30px;
}

.summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
}

.summary-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #475569;
}

.summary-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 15px 0;
}

.summary-grand-total {
    font-size: 1.2rem;
    color: #0f172a;
}

.summary-grand-total strong {
    color: #2563eb;
    font-size: 1.4rem;
    font-weight: 800;
}

.btn-checkout-primary {
    display: block;
    width: 100%;
    background-color: #10b981;
    color: #ffffff !important;
    text-decoration: none;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    box-sizing: border-box;
    margin-top: 25px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-checkout-primary:hover {
    background-color: #059669;
}

.payment-security-notice {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Empty State Styling */
.empty-cart-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-cart-state h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.empty-cart-state p {
    color: #64748b;
    margin-bottom: 25px;
}

.btn-continue-shopping {
    display: inline-block;
    background-color: #2563eb;
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.btn-continue-shopping:hover {
    background-color: #1d4ed8;
}

/* ==========================================================================
   MOBILE CART RESPONSIVE STYLING (Table to Premium Card Transformation)
   ========================================================================== */
.mobile-only-label {
    display: none;
}

@media (max-width: 991px) {
    .cart-page-layout {
        flex-direction: column;
        gap: 30px;
        align-items: stretch; /* 1. Force both blocks to stretch to full width */
    }
    .cart-main-content {
        width: 100%; /* 2. Force the cart list area to span 100% width */
        box-sizing: border-box;
    }
    .cart-summary-panel {
        width: 100%;
        position: static;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    /* Strip the global table wrapper's background & borders on mobile */
    .cart-table-wrapper {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        width: 100%;
    }
    
    /* Force table elements to act as blocks spanning 100% width */
    .cart-table, 
    .cart-table tbody, 
    .cart-table tr, 
    .cart-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .cart-table thead {
        display: none; /* Hide desktop table headers */
    }
    
    /* Elevate each row into its own standalone responsive card */
    .cart-item-row {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        margin-bottom: 20px;
        padding: 24px; /* Generous internal padding */
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
        display: flex;
        flex-direction: column;
        gap: 16px; /* Uniform spacing between details */
        width: 100% !important;
    }
    
    .cart-item-row:last-of-type {
        margin-bottom: 0;
    }

    /* Style individual cell rows */
    .cart-table td {
        border: none;
        padding: 0; 
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Image layout adjustments */
    .cart-table td.td-image {
        justify-content: center;
        padding-bottom: 5px;
    }
    
    .cart-thumbnail {
        width: 120px;
        height: 120px;
        object-fit: contain; 
        background-color: #f8fafc;
        border: 1px solid #f1f5f9;
        border-radius: 12px;
        padding: 8px;
    }

    /* Product Title adjustments */
    .cart-table td.td-details {
        justify-content: center;
        text-align: center;
        padding-bottom: 12px;
        border-bottom: 1px dashed #e2e8f0; /* Soft separator lines */
    }
    
    .cart-item-title {
        font-size: 1.15rem;
        font-weight: 800;
        color: #0f172a;
        line-height: 1.4;
    }

    /* Reveal dynamic mobile labels */
    .mobile-only-label {
        display: inline-block;
        font-weight: 600;
        color: #64748b;
        font-size: 0.95rem;
    }
    
    .td-price strong, 
    .td-total strong {
        font-size: 1.05rem;
        color: #0f172a;
    }
    
    .td-total strong {
        color: #2563eb; 
        font-weight: 800;
        font-size: 1.1rem;
    }

    /* Premium Quantity Adjuster alignment on mobile */
    .cart-qty-adjuster {
        height: 38px;
    }
    
    .qty-btn {
        width: 36px;
        height: 38px;
    }
    
    .qty-input {
        width: 48px;
        height: 38px;
    }

    /* Action / Remove Button adjustments */
    .td-action {
        padding-top: 6px;
    }
    
    .btn-remove-item {
        width: 100%;
        background-color: #fee2e2;
        color: #ef4444;
        padding: 12px;
        border-radius: 10px;
        text-align: center;
        font-size: 0.95rem;
        font-weight: 700;
        border: 1px solid #fecaca;
        transition: all 0.2s ease;
    }
    
    .btn-remove-item:hover {
        background-color: #fecaca;
        transform: translateY(-1px);
    }
}

/* ==========================================================================
   CHECKOUT & SUCCESS STYLINGS
   ========================================================================== */
.checkout-layout-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    gap: 40px;
    align-items: flex-start;
    box-sizing: border-box;
}

.checkout-main {
    flex: 2;
    min-width: 0;
}

.checkout-summary {
    flex: 1;
    min-width: 340px;
    position: sticky;
    top: 30px;
}

.checkout-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    box-sizing: border-box;
}

.checkout-card h2, .checkout-card h3 {
    margin-top: 0;
    color: #0f172a;
    font-weight: 800;
}

.checkout-card h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

/* Form Styling */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #475569;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Summary Items */
.checkout-item-row-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.checkout-item-details {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.checkout-item-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.checkout-item-qty {
    font-size: 0.8rem;
    color: #64748b;
}

.checkout-item-price {
    font-size: 0.95rem;
    color: #0f172a;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 12px;
}

.grand-total-row {
    font-size: 1.1rem;
    color: #0f172a;
}

.grand-total-row strong {
    color: #2563eb;
    font-size: 1.4rem;
    font-weight: 800;
}

/* Fullscreen Loader Overlay */
.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.overlay-spinner-box {
    text-align: center;
    max-width: 400px;
    padding: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .checkout-layout-wrapper {
        flex-direction: column-reverse; /* Put Order Summary on Top for mobile priority context */
        gap: 30px;
    }
    .checkout-main, .checkout-summary {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Success Page Styling */
.success-page-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8fafc;
    padding: 20px;
    box-sizing: border-box;
}

.success-card {
    background: #ffffff;
    max-width: 550px;
    width: 100%;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    text-align: center;
    box-sizing: border-box;
}

.success-icon-badge {
    width: 70px;
    height: 70px;
    background-color: #d1fae5;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 25px auto;
}

.success-card h1 {
    font-size: 2rem;
    font-weight: 850;
    color: #0f172a;
    margin-bottom: 15px;
}

.success-intro {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.order-receipt-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    margin-bottom: 30px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #475569;
}

.receipt-row span:first-child {
    font-weight: 600;
}

.highlight-ref {
    color: #2563eb;
    font-family: monospace;
    font-size: 1rem;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 15px 0;
}

.receipt-grand-total {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 0;
}

.receipt-grand-total strong {
    color: #10b981;
    font-size: 1.35rem;
    font-weight: 800;
}

.next-steps-info {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-success-primary {
    display: inline-block;
    background-color: #2563eb;
    color: #ffffff !important;
    text-decoration: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.2s;
}

.btn-success-primary:hover {
    background-color: #1d4ed8;
}

/* Custom Portal Badge */
.checkout-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 25px;
}
.checkout-card-header h2 {
    border: none;
    padding: 0;
    margin: 0;
}
.badge-portal-session {
    background: #d1fae5;
    color: #065f46;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Custom Checkbox Design */
.checkbox-wrapper {
    display: block;
}
.custom-checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    user-select: none;
}
.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s;
}
.custom-checkbox-container:hover input ~ .checkmark {
    background-color: #e2e8f0;
}
.custom-checkbox-container input:checked ~ .checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.custom-checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.custom-checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* CSS Max-Height Slide Transition for Password Box */
.collapsible-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 0;
}
.collapsible-section.open {
    max-height: 120px; /* Expands dynamically to contain password field */
    opacity: 1;
}