Summary of significant accounting policies | NOTE 1 – SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES Nature of business: O’Reilly Automotive, Inc. and its subsidiaries, collectively, “O’Reilly” or the “Company,” is a specialty retailer and supplier of automotive aftermarket parts. The Company’s stores carry an extensive product line, including new and remanufactured automotive hard parts, maintenance items and various automotive accessories. As of December 31, 2017 , the Company owned and operated 5,019 stores in 47 states, servicing both do-it-yourself (“DIY”) and the professional service provider customers. The Company’s robust distribution system provides stores with same-day or overnight access to an extensive inventory of hard-to-find items not typically stocked in the stores of other auto parts retailers. Segment reporting: The Company is managed and operated by a single management team reporting to the chief operating decision maker. O’Reilly stores have similar characteristics, including the nature of the products and services, the type and class of customers and the methods used to distribute products and provide service to its customers and, as a whole, make up a single operating segment. The Company does not prepare discrete financial information with respect to product lines, types of customers or geographic locations and as such has one reportable segment. Principles of consolidation: The consolidated financial statements include the accounts of the Company and its wholly-owned subsidiaries. All inter-company balances and transactions have been eliminated in consolidation. Use of estimates: The preparation of the consolidated financial statements, in conformity with United States generally accepted accounting principles (“GAAP”), requires management to make estimates and assumptions that affect the amounts reported in the consolidated financial statements and accompanying notes. Actual results could materially differ from those estimates. Cash equivalents: Cash equivalents include investments with maturities of 90 days or less on the date of purchase. Accounts receivable: The Company maintains allowances for doubtful accounts for estimated losses resulting from the inability of the Company’s customers to make required payments. The Company considers the following factors when determining if collection is reasonably assured: customer creditworthiness, past transaction history with the customer, current economic and industry trends and changes in customer payment terms. Allowances for doubtful accounts are determined based on historical experience and an evaluation of the current composition of accounts receivable. Amounts due to the Company from its Team Members are included in “Accounts receivable” on the accompanying Consolidated Balance Sheets. These amounts consist primarily of purchases of merchandise on Team Member accounts. Accounts receivable due from Team Members was approximately $0.9 million and $1.2 million as of December 31, 2017 and 2016 , respectively. The Company grants credit to certain customers who meet the Company’s pre-established credit requirements. Concentrations of credit risk with respect to these receivables are limited because the Company’s customer base consists of a large number of small customers, spreading the credit risk across a broad base. The Company also controls this credit risk through credit approvals, credit limits and accounts receivable and credit monitoring procedures. Generally, the Company does not require security when credit is granted to customers. Credit losses are provided for in the Company’s consolidated financial statements and have consistently been within management’s expectations. Amounts receivable from suppliers: The Company receives concessions from its suppliers through a variety of programs and arrangements, including allowances for new stores and warranties, volume purchase rebates and co-operative advertising. Co-operative advertising allowances that are incremental to the Company’s advertising program, specific to a product or event and identifiable for accounting purposes are reported as a reduction of advertising expense in the period in which the advertising occurred. All other supplier concessions are recognized as a reduction to the cost of sales. Amounts receivable from suppliers also include amounts due to the Company for changeover merchandise and product returns. The Company regularly reviews supplier receivables for collectability and assesses the need for a reserve for uncollectable amounts based on an evaluation of the Company’s suppliers’ financial positions and corresponding abilities to meet financial obligations. Management does not believe there is a reasonable likelihood that the Company will be unable to collect the amounts receivable from suppliers and the Company did not record a reserve for uncollectable amounts from suppliers in the consolidated financial statements as of December 31, 2017 or 2016 . Inventory: Inventory, which consists of automotive hard parts, maintenance items, accessories and tools, is stated at the lower of cost or market. Inventory also includes capitalized costs related to procurement, warehousing and distribution centers (“DC”s). Cost has been determined using the last-in, first-out (“LIFO”) method, which more accurately matches costs with related revenues. Over time, as the Company’s merchandise inventory purchases have increased, the Company negotiated improved acquisition costs from its suppliers and the corresponding price deflation exhausted the Company’s LIFO reserve balance. The Company’s policy is to not write up the value of its inventory in excess of its replacement cost, and accordingly, the Company’s merchandise inventory has been effectively recorded at replacement cost since December 31, 2013. The replacement cost of inventory was $3.01 billion and $2.78 billion as of December 31, 2017 and 2016 , respectively. LIFO costs exceeded replacement costs by $157.3 million and $132.0 million at December 31, 2017 and 2016 , respectively. Fair value of financial instruments: The Company uses the fair value hierarchy, which prioritizes the inputs used to measure the fair value of certain of its financial instruments. The hierarchy gives the highest priority to unadjusted quoted prices in active markets for identical assets or liabilities (Level 1 measurement) and the lowest priority to unobservable inputs (Level 3 measurement). The Company uses the income and market approaches to determine the fair value of its assets and liabilities. The three levels of the fair value hierarchy are set forth below: • Level 1 – Quoted prices (unadjusted) in active markets for identical assets or liabilities that the reporting entity can access at the measurement date. • Level 2 – Inputs other than quoted prices in active markets included within Level 1 that are observable for the asset or liability, either directly or indirectly. • Level 3 – Unobservable inputs for the asset or liability. See Note 2 for further information concerning the Company’s financial and non-financial assets and liabilities measured at fair value on a recurring and non-recurring basis. Property and equipment: Property and equipment are carried at cost. Depreciation is calculated using the straight-line method, generally over the estimated useful lives of the assets. Leasehold improvements are amortized over the lesser of the lease term or the estimated economic life of the assets. The lease term includes renewal options determined by management at lease inception, for which failure to execute renewal options would result in a substantial economic penalty to the Company. Maintenance and repairs are charged to expense as incurred. Upon retirement or sale, the cost and accumulated depreciation are eliminated and the gain or loss, if any, is recognized in the Company’s Consolidated Statements of Income. The Company reviews long-lived assets for impairment whenever events or changes in circumstances indicate that the carrying amount of an asset may not be fully recoverable. Notes receivable: Historically, the Company has utilized notes receivable from supplier and other third parties; however, during the year ended December 31, 2016, the notes receivable from suppliers and other third parties were dissolved, in connection with new supplier contracts, and during the years ended December 31, 2017 and 2016, no new notes receivable arrangements were entered into. Goodwill and other intangibles: The accompanying Consolidated Balance Sheets at December 31, 2017 and 2016 , include goodwill and other intangible assets recorded as the result of acquisitions. The Company reviews goodwill for impairment annually during the fourth quarter, or when events or changes in circumstances indicate the carrying value of these assets might exceed their current fair values. During 2017 and 2016 , the goodwill impairment test included a quantitative assessment, which compared the fair value of the reporting unit to its carrying amount, including goodwill. The Company operates as a single reporting unit, and the Company determined that its fair value exceeded its carrying value, including goodwill, as of December 31, 2017 and 2016 ; as such, no goodwill impairment adjustment was required as of December 31, 2017 and 2016 . Finite-lived intangibles are carried at cost and amortization is calculated using the straight-line method, generally over the estimated useful lives of the intangibles. Impairment of long-lived assets: The Company reviews its long-lived assets for impairment whenever events or changes in circumstances indicate that the carrying value of an asset may not be recoverable. When such an event occurs, the Company compares the sum of the undiscounted expected future cash flows of the asset (asset group) with the carrying amounts of the asset. If the undiscounted expected future cash flows are less than the carrying value of the assets, the Company measures the amount of impairment loss as the amount, by which the carrying amount of the assets exceeds the fair value of the assets. The Company has not historically recorded any material impairment charges to its long-lived assets and the Company did not record a material impairment charge to its long-lived assets during the year ended December 31, 2017 or 2016 . Valuation of investments: The Company has an unsecured obligation to pay, in the future, the value of deferred compensation and a Company match relating to employee participation in the Company’s nonqualified deferred compensation plan (the “Deferred Compensation Plan”). See Note 9 for further information concerning the Company’s benefit plans. The future obligation is adjusted to reflect the performance, whether positive or negative, of selected investment measurement options, chosen by each participant. The Company invests in various marketable securities with the intention of selling these securities to fulfill its future obligations under the Deferred Compensation Plan. The investments in this plan were stated at fair value based on quoted market prices, were accounted for as trading securities and were included in “Other assets, net” on the accompanying Consolidated Balance Sheets as of December 31, 2017 and 2016 . See Note 2 for further information concerning the fair value measurements of the Company’s marketable securities. Self-insurance reserves: The Company uses a combination of insurance and self-insurance mechanisms to provide for potential liabilities for Team Member health care benefits, workers’ compensation, vehicle liability, general liability and property loss. With the exception of certain Team Member health care benefit liabilities, employment related claims and litigation, certain commercial litigation and certain regulatory matters, the Company obtains third-party insurance coverage to limit its exposure. The Company estimates its self-insurance liabilities by considering a number of factors, including historical claims experience and trend-lines, projected medical and legal inflation, growth patterns and exposure forecasts. Certain of these liabilities were recorded at an estimate of their net present value, using a credit-adjusted discount rate. The following table identifies the components of the Company’s self-insurance reserves as of December 31, 2017 and 2016 (in thousands): December 31, 2017 2016 Self-insurance reserves (undiscounted) $ 147,664 $ 138,687 Self-insurance reserves (discounted) 137,970 129,437 The current portion of the Company’s discounted self-insurance reserves totaled $71.7 million and $67.9 million as of December 31, 2017 and 2016 , respectively, which was included in “Self-insurance reserves” on the accompanying Consolidate Balance Sheets as of December 31, 2017 and 2016 . The remainder was included in “Other liabilities” on the accompanying Consolidated Balance Sheets as of December 31, 2017 and 2016 . Warranties: The Company offers warranties on certain merchandise it sells with warranty periods ranging from 30 days to limited lifetime warranties. The risk of loss arising from warranty claims is typically the obligation of the Company’s suppliers. Certain suppliers provide upfront allowances to the Company in lieu of accepting the obligation for warranty claims. For this merchandise, when sold, the Company bears the risk of loss associated with the cost of warranty claims. Differences between supplier allowances received by the Company, in lieu of warranty obligations and estimated warranty expense, are recorded as an adjustment to cost of sales. Estimated warranty costs, which are recorded as obligations at the time of sale, are based on the historical failure rate of each individual product line. The Company’s historical experience has been that failure rates are relatively consistent over time and that the ultimate cost of warranty claims to the Company has been driven by volume of units sold as opposed to fluctuations in failure rates or the variation of the cost of individual claims. See Note 7 for further information concerning the Company’s aggregate product warranty liabilities. Litigation reserves: O’Reilly is currently involved in litigation incidental to the ordinary conduct of the Company’s business. The Company records reserves for litigation losses in instances where a material adverse outcome is probable and the Company is able to reasonably estimate the probable loss. The Company reserves for an estimate of material legal costs to be incurred in pending litigation matters. Although the Company cannot ascertain the amount of liability that it may incur from any of these matters, it does not currently believe that, in the aggregate, these matters, taking into account applicable insurance and reserves, will have a material adverse effect on its consolidated financial position, results of operations or cash flows in a particular quarter or annual period. See Note 14 for further information concerning the Company’s litigation reserves. Share repurchases: In January of 2011, the Company’s Board of Directors approved a share repurchase program. Under the program, the Company may, from time to time, repurchase shares of its common stock, solely through open market purchases effected through a broker dealer at prevailing market prices, based on a variety of factors such as price, corporate trading policy requirements and overall market conditions. All shares repurchased under the share repurchase program are retired and recorded under the par value method on the accompanying Consolidated Balance Sheets. See Note 8 for further information concerning the Company’s share repurchase program. Revenue recognition: Over-the-counter retail sales are recorded when the customer takes possession of the merchandise. Sales to professional service provider customers, also referred to as “commercial sales,” are recorded upon same-day delivery of the merchandise to the customer, generally at the customer’s place of business. Wholesale sales to other retailers, also referred to as “jobber sales,” are recorded upon shipment of the merchandise from a regional DC with same-day delivery to the jobber customer’s location. Internet retail sales are recorded when the merchandise is shipped or when the merchandise is picked up in a store. All sales are recorded net of estimated returns allowances, discounts and taxes. The Company maintains a retail loyalty program named O’Reilly O’Rewards, designed to build brand recognition. The program allows a retail customer to enroll at no charge, does not impose a membership fee and provides members with the ability to earn loyalty points by making qualifying purchases at the Company’s stores. Upon reaching established thresholds, the members are automatically issued coupons, which expire 90 days after issuance, have no cash value and may be redeemed for most items in the Company’s stores with a total purchase price equal to or greater than the value of the coupon. Points accrued in a member’s account, which have not been awarded to the member with a coupon, expire 12 months after the date that they were earned. The Company records a deferred revenue liability, based on a breakage adjusted estimated redemption rate, and a corresponding reduction in revenue in periods when loyalty points are earned by members. The Company recognizes revenue and a corresponding reduction to the deferred revenue liability in periods when loyalty program issued coupons are redeemed by members. As of December 31, 2017 and 2016 , the Company had recorded a deferred revenue liability of $4.7 million and $4.8 million , respectively, related to its loyalty program, which were included in “Other liabilities” in the accompanying Consolidated Balance Sheets. During the year ended December 31, 2017 and 2016 , the Company recognized $17.6 million and $12.7 million , respectively, of deferred revenue related to its loyalty program. Cost of goods sold and selling, general and administrative expenses: The following table illustrates the primary costs classified in each major expense category: Cost of goods sold, including warehouse and distribution expenses Selling, general and administrative expenses Total cost of merchandise sold, including: Payroll and benefit costs for store and corporate Team Members Freight expenses associated with acquiring merchandise and with moving merchandise inventories from the Company’s distribution centers to the stores Occupancy costs of store and corporate facilities Defective merchandise and warranty costs Depreciation and amortization related to store and corporate assets Supplier allowances and incentives, including: Vehicle expenses for store delivery services Allowances that are not reimbursements for specific, incremental and identifiable costs Self-insurance costs Cash discounts on payments to suppliers Closed store expenses Costs associated with the Company’s supply chain, including: Other administrative costs, including: Payroll and benefit costs Accounting, legal and other professional services Warehouse occupancy costs Bad debt, banking and credit card fees Transportation costs Supplies Depreciation Travel Inventory shrinkage Advertising costs Operating leases: The Company recognizes rent expense on a straight-line basis over the lease terms of its stores, DCs and corporate offices. Generally, the lease term for stores and corporate offices is the base lease term and the lease term for DCs includes the base lease term plus certain renewal option periods, for which renewal is reasonably assured and failure to exercise the renewal option would result in a significant economic penalty. The Company’s policy is to amortize leasehold improvements associated with the Company’s operating leases over the lesser of the lease term or the estimated economic life of those assets. See Note 6 for further information concerning the Company’s operating leases. Advertising expenses: Advertising expense consists primarily of expenses related to the Company’s integrated marketing program, which includes television, radio, direct mail and newspaper distribution, in-store and online promotions, and sports and event sponsorships. The Company expenses advertising costs as incurred. The Company also participates in cooperative advertising arrangements with certain of its suppliers. Advertising expense, net of cooperative advertising allowances from suppliers that were incremental to the advertising program, specific to the product or event and identifiable for accounting purposes, total $83.7 million , $83.0 million and $79.3 million for the years ended December 31, 2017 , 2016 and 2015 , respectively, which were included in “Selling, general and administrative expenses” on the accompanying Consolidated Statements of Income. Share-based compensation and benefit plans: The Company sponsors employee share-based benefit plans and employee and director share-based compensation plans. The Company recognizes compensation expense over the requisite service period for its share-based plans based on the fair value of the awards on the date of the grant, award or issuance. Share-based plans include stock option awards issued under the Company’s employee incentive plans and director stock plan, stock issued through the Company’s employee stock purchase plan and restricted stock awarded to employees and directors through other compensation plans. See Note 9 for further information concerning the Company’s share-based compensation and plans. Pre-opening expenses: Costs associated with the opening of new stores, which consist primarily of payroll and occupancy costs, are charged to “Selling, general and administrative expenses” on the accompanying Consolidated Statements of Income as incurred. Costs associated with the opening of new distribution centers, which consist primarily of payroll and occupancy costs, are included in “Cost of goods sold, including warehouse and distribution expenses” on the accompanying Consolidated Statements of Income as incurred. Interest expense: The Company capitalizes interest costs as a component of construction in progress, based on the weighted-average interest rates incurred on its long-term borrowings. Total interest costs capitalized for the years ended December 31, 2017 , 2016 and 2015 , were $8.5 million , $7.9 million and $7.4 million , respectively, which were included in “Interest expense” on the accompanying Consolidated Statements of Income. In conjunction with the issuance or amendment of long-term debt instruments, the Company incurs various costs, including debt registration fees, accounting and legal fees and underwriter and book runner fees. Debt issuance costs related to the Company’s long-term unsecured senior notes are recorded as a reduction of the principal amount of the corresponding unsecured senior notes. Debt issuance costs related to the Company’s unsecured revolving credit facility are recorded as an asset. These debt issuance costs have been deferred and are being amortized over the term of the corresponding debt instrument and the amortization expense is included in “Interest expense” on the accompanying Consolidated Statements of Income. Deferred debt issuance costs totaled $15.9 million and $10.6 million , net of accumulated amortization, as of December 31, 2017 and 2016 , respectively, of which $2.0 million and $0.7 million were included in “Other assets, net” as of December 31, 2017 and 2016 , respectively, with the remainder included in “Long-term debt” on the accompanying Consolidated Balance Sheets. The Company issued its long-term unsecured senior notes at a discount. The original issuance discount on the senior notes is recorded as a reduction of the principal amount due for the corresponding senior notes and is accreted over the term of the applicable senior note, with the accretion expense included in “Interest expense” on the accompanying Consolidated Statements of Income. Original issuance discounts, net of accretion, totaled $3.7 million and $3.1 million as of December 31, 2017 and 2016 , respectively. See Note 5 for further information concerning debt issuance costs and original issuance discounts associated with the Company’s issuances of long-term debt instruments. Income taxes: The Company accounts for income taxes using the liability method, which requires the recognition of deferred tax assets and liabilities for the expected future tax consequences of events that have been included in the financial statements. Under this method, deferred tax assets and liabilities are determined based on differences between the GAAP basis and tax basis of assets and liabilities using enacted tax rules and rates currently scheduled to be in effect for the year in which the differences are expected to reverse. Tax carry forwards are also recognized in deferred tax assets and liabilities under this method. The effect of a change in tax rates on deferred tax assets and liabilities is recognized in income in the period of the enactment date. The Company would record a valuation allowance against deferred tax assets to the extent it is more likely than not the amount will not be realized, based upon evidence available at the time of the determination and any change in the valuation allowance is recorded in the period of a change in such determination. The Company did not establish a valuation allowance for deferred tax assets as of December 31, 2017 and 2016 , as it was considered more likely than not that deferred tax assets were realizable through a combination of future taxable income, the realization of deferred tax liabilities and tax planning strategies. The Company regularly reviews its potential tax liabilities for tax years subject to audit. The amount of such liabilities is based on various factors, such as differing interpretations of tax regulations by the responsible tax authority, experience with previous tax audits and applicable tax law rulings. In management’s opinion, adequate provisions for income taxes have been made for all years presented. The estimates of the Company’s potential tax liabilities contain uncertainties because management must use judgment to estimate the exposures associated with the Company’s various tax positions and actual results could differ from estimates. See Note 12 for further information concerning the Company’s income taxes. Earnings per share: Basic earnings per share is calculated by dividing net income by the weighted-average number of common shares outstanding during the fiscal period. Diluted earnings per share is calculated by dividing the weighted-average number of common shares outstanding plus the common stock equivalents associated with the potential impact of dilutive stock options. Certain common stock equivalents that could potentially dilute basic earnings per share in the future were not included in the fully diluted computation because they would have been antidilutive. Generally, stock options are antidilutive and excluded from the earnings per share calculation when the exercise price exceeds the market price of the common shares. See Note 13 for further information concerning the Company’s common stock equivalents. New accounting pronouncements: In May of 2014, the Financial Accounting Standards Board (the “FASB”) issued Accounting Standard Update (“ASU”) No. 2014-09, “Revenue from Contracts with Customers (Topic 606)” (“ASU 2014-09”). Under ASU 2014-09, an entity is required to follow a five-step process to determine the amount of revenue to recognize when promised goods or services are transferred to customers. ASU 2014-09 offers specific accounting guidance for costs to obtain or fulfill a contract with a customer. In addition, an entity is required to disclose sufficient information to understand the nature, amount, timing, and uncertainty of revenue and cash flows arising from contracts with customers. In August of 2015, the FASB issued ASU No. 2015-14, “Revenue from Contracts with Customers (Topic 606): Deferral of the Effective Date” (“ASU 2015-14”), to defer the effective date of ASU 2014-09 by one year. For public companies, ASU 2015-14 changes ASU 2014-09 to be effective for annual reporting periods beginning after December 15, 2017, including interim periods within that reporting period. These ASUs can be adopted retrospectively or as a cumulative-effective adjustment at the date of adoption. The Company has substantially completed its evaluation of the impact of the adoption of ASU 2014-09, and the Company will adopt this guidance beginning with its first quarter ending March 31, 2018, using the modified retrospective transition method. Results for annual reporting periods beginning after December 31, 2017, will be presented under ASU 2014-09, while prior period amounts will not be adjusted and will continue to be reported under the accounting standards in effect for the prior periods. The Company’s primary source of revenue is derived from the sale of automotive aftermarket parts to its customers, and generally, the Company’s performance obligations are satisfied immediately when the parts are delivered to the customer, which normally occurs the same day the customer orders the part. As such, the adoption of the new standard will not have a material impact on the Company’s consolidated financial condition, results of operations or cash flows; further, the Company does not expect significant changes to its business process, internal controls or systems as a result of adopting ASU 2014-09. In February of 2016, the FASB issued ASU No. 2016-02, “Leases (Topic 842)” (“ASU 2016-02”). Under ASU 2016-02, an entity will be required to recognize right-of-use assets and lease liabilities on its balance sheet and disclose key information about leasing arrangements. ASU 2016-02 offers specific accounting guidance for a lessee, a lessor and sale and leaseback transactions. Lessees and lessors are required to disclose qualitative and quantitative information about leasing arrangements to enable a user of the financial statements to assess the amount, timing and uncertainty of cash flows arising from leases. For public companies, ASU 2016-02 is effective for annual reporting periods beginning after December 15, 2018, including interim periods within that reporting period, and requires a modified retrospective adoption, with early adoption permitted. The Company will adopt this guidance beginning with its first quarter ending March 31, 2019. The Company has established a task force, composed of multiple functional groups inside of the Company, which is currently in the process of evaluating critical components of this new guidance and the potential impact of the guidance on the Company’s financial position, results of operations and cash flows. Based on the preliminary work completed, the Company is considering the potential implications of the new standard on determining the discount rate to be used in valuing new and existing leases, the treatment of existing favorable and unfavorable lease agreements acquired in connection with previous acquisitions, procedural and operational changes that may be necessary to comply with the provisions of the guidance and all applicable financial statement disclosures required by the new guidance, all of which are areas that could potentially be impacted by adoption of the guidance. At this time, the task force has not completed its full evaluation; however, the Company believes the adoption of the new guidance will have a material impact on the total assets and total liabilities reported on the Company’s consolidated balance sheets. In March of 2016, the FASB issued ASU No. 2016-09, “Compensation - Stock Compensation (Topic 718): Improvements to Employee Share-Based Payment Accounting” (“ASU 2016-09”). Under ASU 2016-09, several aspects of the accounting for share-based payment transactions, including tax consequence, classification of awards as equity or liabilities, and classification on the statement of cash flows, were changed. The Company adopted this guidance with its first quarter ending March 31, 2017. Upon adoption of ASU 2016-09, the Company elected to change its accounting policy to account for forfeitures as they occur; this change was applied using the modified retrospective transition method with a cumulative effect adjustment of $0.3 million to opening “Retained earnings” on the accompanying Consolidated Balance Sheet as of December 31, 2017 . The Company applied the amendments related to the presentation of tax withholdings on the statements of cash flows using the retrospective transition method, which resulted in $0.6 million and $0.9 million of tax withholdings being reclassified from “ |